Code Monkey home page Code Monkey logo

letscode-exercises-java's Introduction

Java Exercises - Let's Code

This repository contains 5 Java exercises made by Let's Code (Ada Tech).

JDK Version

  • Zulu 17.0.5 LTS

IDE

  • IntelliJ IDEA Community Edition 2022.1.4

Exercises

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.

Input

37

Output

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.

Input

33

Output

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.

Input

banana
lemon
lemon
banana
apple

Output

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]

Input

grape

Output

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]

Input

banana
limão
limão
uva
Pêra
kiwi
melancia
banana

Output

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.

Input

banana
limão
uva
Pêra
grape
orange
lemon
banana

Output

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.

letscode-exercises-java's People

Contributors

ismaelmoura avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.