Question: [1] Write a program with a method named evaluateGrade() that accepts multiple students (at least 5) grades (ranging from 1 to 100) by using a

[1] Write a program with a method named evaluateGrade() that accepts multiple students (at least 5) grades (ranging from 1 to 100) by using a Scanner and returns the students' course grades on the 4.0 scale. To stop grade input, please use '-1'. Use the following reference mapping table. (You don't need to check the number of students at this program. Just input more than 5 grades.) (2pts)

Score <= 60 61 62 63 ... 98 99 100
Grade 0.0 0.1 0.2 0.3 ... 3.8 3.9 4.0

The program interface is as follows:

Type grade : 90

Grade scale is 3.0

Type grade : 91

Grade scale is 3.1

Type grade : 95

Grade scale is 3.5

Type grade : -1

Bye!

[2] Write a program to prompt a user for the number of integers and the integers (at least 5, ranging from 0 to 100) and print the minimum, maximum, total sum, and average of the numbers. (2pts)

The program interface is as follows:

How many integers? 6

Next integer? 100

Next integer? 97

Next integer? 68

Next integer? 85

Next integer? 88

Next integer? 76

Min = 68

Max = 100

Sum = 514

Avg = 85.67

O Tokenizing

[3] Write a static method named numberStatistics that accepts input from the console Scanner or File. The text is a series of strings (name) and integers (score). The method should process this text line and report various statistics about the integers. Report the total number of the numbers, the sum of the numbers, the average of the numbers and the minimum and maximum numbers. For example, if the text is the following: (3pts)

Remark: In order to read data from console, you need to consider using sentinel value (-1 or -999) to stop the iteration to get the data within while loop.

Helene 5 Jordan 7 Eve 2 Ken 8 Andrew 9 David 10 Amy 12 Sean 98 Patrick 7 Joy 14 Sue 20 Jimmy 22

*Note: Please assume the above text is given as a single line of text.

Your method should produce the following output.

Total numbers = 12

Sum of numbers = 214

Average score = 17.833

minimum number = 2

maximim number = 98

[4] Write a static method named negativeSum() that accepts a string of text as a parameter from the standard console input stream. Assume that the text is a series of integers, and determine whether or not the cumulative sum starting from the first number is ever negative. The method should produce a message indicating whether or not a negative sum is possible and it should return true if a negative sum can be reached and false if it can't be reached. For example, if the string contains the following text,

"38 4 19 -27 -15 -3 4 19 38"

your method will consider the sum of just one number (38), the sum of the first two numbers (38 + 4), the sum of the first three numbers (38 + 4 + 19), and so on up to the sum of all of the numbers. None of these sums is negative, so the method would produce the following message:

no negative sum

and would return false. If the text is the following,

"14 7 -10 9 -18 -10 17 42 98"

the method finds that a negative sum is reached after adding 6 numbers together

(14 + 7 + -10 + 9 + -18 + -10) and that the sum is -8. It should report the following:

-8 after 6 steps

and should return true, indicating that a negative sum can be reached. (3pts)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!