Now before i get into the question, i am NOT asking to be spoon fed the code for the program, i just need help on how to do it myself, whether its you explaining it, a link to a video, or some kind of online resource. I am heavily in need of help for my school assignment. Here are the instructions:
"1. Write a program that calls each of the methods of the Math class from the list below and provides output showing the method called, values sent to the method, and returned results. Each listed method will tell you which values to use. For example:
Listed method: double pow(double a, double b) : use 2.0 and 3.0
Your program would display: Math.pow(2.0, 3.0) = 8.0
When calling a method that accepts doubles, use numbers with at least one decimal digit like the example above, even if it's a zero. Remember that numbers with decimals are double literals. Try to use vales that will produce easily verifiable results. Here is the list:
double pow(double a, double b): Use 3.0 and 2.0
double sqrt(double x): Use 25.0
int max(int a, int b): Use 6 and 2
double max(double a, double b): Use -50.0 and 7.0
static double random()
Sample output:
Math.pow(3.0, 2.0) = 9.0
Math.sqrt(25.0) = 5.0
Math.max(6, 2) = 6
Math.max(-50.0, 7.0) = 7.0
Math.random()= 0.7131281909476174
Test your program with the values shown in the examples and verify your program produces the same results. (Your random value will be different.) Troubleshoot and fix any errors that you find.
Add a method to your program called 'randomStudy' that has no parameters and returns no value. In this method, do the following: a. declare three int variables: total, min, and max. Set total to 0, min to 11 and max to -1. b. Create a loop that will run 1,000 times. In the body of the loop generate a random int value between 1 and 10, inclusive. Add this number to your total. If this number is less than min, update min with the new number, If it is greater than max, update max with the new number. c. After the loop, display the following:
Min value: x Max value: y Average: z
Replace x and y with your min and max values. Calculate z by dividing your total by 1000d
- Call your new randomStudy method from the main method."
Like i said in the first few sentences, im not looking for someone to just give me the code to copy and paste, i just want to know how to do this, as i am new to java, and just need someone to explain this to me with some more simplified instructions and sample code, or to link me to videos or another resource. I don't have any code yet. Thanks.