Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your task is to create a program that uses the Math class. The program will work as follows: 1. Your program will prompt the user

Your task is to create a program that uses the Math class. The program will work as follows:

1. Your program will prompt the user for a decimal value; the user response will be the starting point of the calculations.

2. Using the appropriate method from the Random class, the program will generate a random number between 1 and 5

3. The program will then use one of the 5 basic operations in Java (your choice) to calculate a new number using the user entry and the random value as operands.

4. The program will print a text describing the operation above

a. E.g., Your entry has been multiplied by 2

5. The program will call the Math function of your choice, using the number calculated above as the actual parameter for the call.

6. Lastly the program will print another text describing the calculation

a. E.g., The name of math function here of argument value here is result of function call here.

In addition, ensure that:

comments are present where appropriate

variables names are clear and descriptive

you respect correct indentation

you align programming statements correctly

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inductive Databases And Constraint Based Data Mining

Authors: Saso Dzeroski ,Bart Goethals ,Pance Panov

2010th Edition

1489982175, 978-1489982179

More Books

Students also viewed these Databases questions

Question

How can you influence the powers that be to make changes?

Answered: 1 week ago