This repository contains 5 Java exercises made by Let's Code (Ada Tech).
- Zulu 17.0.5 LTS
- IntelliJ IDEA Community Edition 2022.1.4
You can find the original document (in portuguese) here: java-exercises-list-and-final-challenge
Write a program that informs the multiplication table (1 to 10) of a number informed by user.
37
37 X 1 = 37
37 X 2 = 74
37 X 3 = 111
37 X 4 = 148
37 X 5 = 185
37 X 6 = 222
37 X 7 = 259
37 X 8 = 296
37 X 9 = 333
37 X 10 = 370
Write a program that converts the temperature from Celsius to Fahrenheit.
33
The equivalent of 33.00°C is 91.40°F
Write a program that reads the name of 5 fruits and stock in the shopping cart. In the end of 5 entries, show the complete list.
banana
lemon
lemon
banana
apple
Your shopping cart have:
[BANANA, LEMON, APPLE]
A supermarket daily announce a list of 5 fruits on sale. Write a program that receive the name of fruit do you want to buy and inform if this fruit is on sale.
For example:
Fruits on sale today: [ORANGE, BANANA, GRAPE, LEMON]
grape
Good choice! This fruit is on sale today.
Write a program that compares a shopping list and calculates the 5% discount accrued for each fruit found on the list.
For example:
Fruits on sale today: [BANANA, PINEAPPLE, WATERMELON, LEMON, GRAPE]
banana
limão
limão
uva
Pêra
kiwi
melancia
banana
You bought this fruits on sale: [BANANA]
Therefore, you will receive a 5% discount.
Write a program that calculates the buyer's tip based on the correspondence between what was requested and what was actually purchased. Following those parameters:
- Purchases correspond to 50% or more of the list, tip of R$ 3.00;
- Purchases correspond to 75% or more of the list, tip of R$ 5.00;
- Purchases correspond to 90% or more of the list, tip of R$ 10.00.
banana
limão
uva
Pêra
grape
orange
lemon
banana
Client list: [BANANA, LIMÃO, UVA, PÊRA, GRAPE, ORANGE, LEMON]
Purchased fruits: [ORANGE, BANANA, GRAPE, LEMON]
57% of correspondence, tip of R$ 3,00.