Skip to content

JoaoPedroBarriga/R4E_Algorithms_101_01

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

R4E_Algorithms_101_01

Software Developer | Algorithms 101: Practical exercises

  • These exercises are a series done in JAVA, using IntelliJ IDEA.

  • To run each one, in src/Main.java -> scroll down to line 539, and input intended exercise number.

  • In src/AlgorithmExercisesSheet <-- List of exercises.

That's all folks!

Reading/Writing - Variables - Conditions - Cycles

EXERCISES – GROUP I - Reading/Writing ; Variables

  1. Create an algorithm that reads a person's name and writes "Hello" followed by the person's name.
  2. Create an algorithm that, after reading two integers, displays their sum.
  3. Create an algorithm that after reading two integers displays their difference.
  4. Reading the base and height of a triangle is intended to calculate its area.
  5. Make a program that receives a value that is the amount paid, a second value that is the price of the product and returns the change to be given.
  6. Make a program that receives the value of a kilo of a product and the amount of kilos of the product consumed calculating the final amount to be paid.
  7. The price of a car is calculated by adding the factory price to the tax price (45% of the price ex-factory price) and dealer percentage (28% of ex-factory price). Write an algorithm that reads the name of the car and factory price, and write the car name and final price.

EXERCISES – GROUP II - Conditions

  1. Write a program that receives 2 values and returns the largest one.
  2. Write a program that receives 4 values and returns the smallest one.
  3. Write a program that checks if a number is odd.
  4. Write a program that receives 3 values that will represent the sides of a triangle and check if the values form a triangle and classify this triangle.
  5. Use the IF structure to make a program that returns the name of a product from its code.
  6. Redo the previous exercise using the structure IF-CASE === switch.case

EXERCISES – GROUP III - CYCLES

  1. Write a program that uses the WHILE structure to read 50 numbers and calculate and display the arithmetic mean from them.
  2. Redo the exercise using the FOR framework.
  3. Given a series of N integer values, create an algorithm that calculates and writes the arithmetic mean of these values.
  4. Adapt the previous exercise considering that if the average obtained is greater than 8, 10 must be assigned to the average.
  5. Given a set of n integers entered by the user, make an algorithm that calculates the average of the values greater than 4.

EXERCISES – GROUP IV

  1. Create a program that lets you convert a value in hours to seconds and displays the value in seconds.
  2. Create a program that lets you convert a value in days to years, weeks, and days.
  3. Create a program that lets you convert a value in bytes to bits.
  4. Create a program to convert a value in Megabytes to Bytes.
  5. Create a program to multiply two numbers without using the multiplication operator.
  6. Read N numbers, determine the largest, smallest and average of the N numbers read.
  7. Create a function that, given a year, checks whether or not it is a leap year.
  8. Write a program that converts a binary value to decimal.

About

Software Developer | Algorithms 101: JAVA w/ IntelliJ IDEA

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages