I need to write a program in java. There are 3 questions :3.1 q1 The user should input the number of numbers they are going to enter. Your job is to find the maximum and the minimum of these numbers....

I need to write a program in java. There are 3 questions :3.1 q1 The user should input the number of numbers they are going to enter. Your job is to find the maximum and the minimum of these numbers. The output of the program if the user does not enter a negative number and all iterations successfully terminate, will be the maximum number, the minimum number and their difference(max-min). If the user inputs a negative number while entering the numbers, you will exit the loop and will not report the min,max and the difference but will write:” Program aborted due to the entrance of a negative number” Exp: The user enters 3 as the number of elements then enters 1,2,4. The output will be: min= 1, max= 4 and the diff is 3. Exp2: The user enters 3 as the number of elements then enters 4,-5. The output will be: ”Program aborted due to the entrance of a negative number” 3.2 q2 In a class of 10 students each student can obtain a grade between 0-100. Your job is to use a switch case control statement to compute the number of each of the students who has obtained one of these grades : A,B,C,F. 1. A student obtains A if their grade is above 90. 2. A student obtains B if their grade is between 80-90. 3. A student obtains C if their grade is between 60-80. 4. A student obtains F, if their grade is less than 60. 3.3 q3: The confused rabbit A greedy rabbit has just learned how to use the mod (%) operator. This Rabbit visits the fields next to its home and wants to take some carrots home. The problem is that each time the rabbit reaches a field, it finds some random number of carrots between zero and 40 there. So, if the rabbit visits field one it might find a random number of carrots, lets say 20 carrots and then when it visits field 2 it might find 1 carrot. So, the number of carrots in each of the fields is a random number. The rabbit will continue visiting different fields until the sum of all of the carrots that it has found is divisible by 17 or it is divisible by 15. (God knows when this will happen but our rabbit does not give up). Your job is to write this game. The number of carrots are random numbers and you will keep visiting different fields until the sum of the carrots found is divisible by 17 or 15. The out put of your code will be the sum and the number of fields visited(iterations).
Oct 18, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here