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
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started