Question: Scanner Class Description and output scannerl Write code to prompt a student for his/her grade using a Scanner, and use the grade method from the



Scanner Class Description and output scannerl Write code to prompt a student for his/her grade using a Scanner, and use the grade method from the previous question to report the student's grade: What percent did you earn? 84 Your grade is 2.4 scanner2 Write code to prompt the user for many integers and print the total sum and maximum of the numbers. How many integers? 5 Next integer? 2 Next integer? 9 Next integer? 17 Next integer? 4 Next integer? 6 Sum = 38 Max = 17 You may assume that the user types at least one integer and that at least one integer will be non-negative.1. In Eclipse, create a new class and name it, MathScanner. In MathScanner.java, first, write a static method min ( ) that meets the requirement min in the worksheet above. Second, write another static method countQuarters ( ) that meets the requirement countQuarters in the worksheet above. A. In main, add a couple of test codes to test min ( ) B. In main, add a couple of test codes to test countQuarters ( ) C. What operator did you use for the count Quarters ( ) and why? 2. Write a static method scanner2 ( ) that meets the requirement scanner 2 in the worksheet, and make sure to test with different inputs. 3. Share your MathScanner.java (just copy your code and paste it here. No need to attach the file)Math Class mathExpressionsZ Write the result of each expression. Assume that each expression follows the ones countQuarters before it, so that the code on a previous line affects what would happen on the next line. Note that a variable's value changes only if you reassign it using the = operator. (Make sure to write a value of the proper type, such as 12.0 rather than 12 for a double.) double grade : 2.7: Hath.round(grade}; grade grade = Math.round(grade): grade double min = Math.min(grade, Math.floor(2.9)l; \" ' m1n , double x = Hath.pow{2, 4): x x = Math.sqrt(6c1}; x int count = 25; Math.sqrt(count): -* ' (aunt count = (int) Math.sqrt(count): \" (ount = int a = Math.abs(Math.min(1, 3}): Write a method called min that takes three integers as parameters and returns the smallest of the three values; for example, a call of min (3 , -2 , 7) would return 2, and a call ofmin (19, 27, 6) would return 6. Use Math . min to write your solution. Write a method called cothuarters that takes an int representing a number of cents as a parameter and returns the number quarter coins represented by that many cents. Don't count any whole dollars, because those would be dispensed as dollar bills. For example, cothuarters(64) would return 2, because 2 quarters make 50 cents, with 14 extra left over. Acall of cothua rte rs(1278) would return 3, because after the 12 dollars are taken out, 3 quarters remain in the 78 cents left
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
