Write a program to read a list of exam scores given as integer percentages in the range 0-100. Display the total number of grades in each letter grade defined as follows:90-100 is an A, 80-89 is a B, 70-79 is a C, 60-69 is a D, 0-59 is an F. Use a negative score as a sentinel to indicate the end of the input. (The negative value is used just to end the loop, do not use it in the calculations). Then output the highest and lowest score, and the average score.For example if the input is: 72 98 87 50 70 86 85 78 73 72 72 66 63 85 -1the output would be:Total number of grades = 14Number of As =1Number of Bs = 4Number of Cs = 6Number of Ds = 2Number of Fs = 1The highest score is 98The lowest score is 50The average is 75.5This is what I have so far and it is not working correctly:public static void main(String[] args) {// scannerScanner scnr =new Scanner (System.in);//ints grades and countint x;int A = 0;int B = 0;int C = 0;int D = 0;int F = 0;int count = 1;//int min max totalint min, max;int total = 0 ;//doubledouble average;//prompt user for inputSystem.out.print("Please enter the exam scores as integer ");System.out.print("percentages in the rage 0-100. ");System.out.println("Please end the list with a negative integer.");//scnrx = scnr.nextInt();min = x;max = x;//while loopwhile (x >= 0){x = scnr.nextInt();if (x >= 0){total = total + x;count++;if (x < min)min = x;if (x > min)max = x; }while (x >= 90 && x <= 100) {x = scnr.nextInt();A++;//Grade Bif (x >= 80 && x <= 89)B++;//Grade Cif (x >= 70 && x <= 79)C++;//Grade Dif (x >= 60 && x <= 69)D++;//Grade Fif (x >= 0 && x <= 59)F++;}}// averageaverage = total/count;//results/outputSystem.out.println("Total number of grades: " + count);System.out.println("Number of A's: " + A);System.out.println("Number of B's: " + B);System.out.println("Number of C's: " + C);System.out.println("Number of D's: " + D);System.out.println("Number of F's: " + F);System.out.println("Highest score: " + max);System.out.println("Lowest score: " + min);System.out.println("Average: " + average);}}

Answers

Answer 1
Answer: system out print , 100-5292

Related Questions

What is the main purpose of the status report? O A. To ensure that management and the team has a clear picture of the state of the project. B. To alert management to exceptional or unusual situations, C. To document the impact of change requests from the client. D. To detail the mistakes made in planning and budgeting,​
Volume of Pyramid = A*h/3 where A is the area of the base of the pyramid and h is the height of the pyramid. Write a C++ program that asks the user to enter the necessary information about the pyramid (note that the user would not know the area of the base of the pyramid, you need to ask them for the length of one of the sides of the base and then calculate the area of the base). Using the information the user input, calculate the volume of the pyramid. Next display the results (rounded to two decimal places). Example Output (output will change depending on user input): The area of the base of the pyramid is: 25.00 The height of the pyramid is: 5.00 The volume of the pyramid is: 41.67 *Pseudocode IS required for this program and is worth 1 point. The program IS auto-graded.
Write a simple arithmetic expression translator that reads in expressions such as 25.5 + 34.2 and displays their value. Each expression has two numbers separated by an arithmetic operator. (Hint: Use a switch statement with the operator symbol (type char) as a selector to determine which arithmetic operation to perform on the two numbers. For a sentinel, enter an expression with zero for both operands.)
What makes a computer a computer?​
___ defines a series of standards for encoding audio and video in digital form for storage or transmission. Most of these standards include compression, often lossy compression.a) JPEG b) ANSI c) ISO d) MPEG

Your app needs to store the following information. For each type of information, decide whether you would use an array or a variable to store it:(a) All the messages a user has sent(b) The highest score a user has ever reached on the app(c) A username and password to unlock the app

Answers

Answer:

Array: (a) All the messages a user has sent.

Variable: (b) The highest score a use has reached on the app. (c) A username and password to unlock the app.

Explanation:

An array generally has more than one value whereas a variable can only contain a single value at any particular point in time. In addition, a variable has a limit whereas an array does not have any maximum limit. Therefore, it can be concluded that option (a) will be stored as an array while options (b) and (c) will be stored as variables.

How many bits would be needed to count all of the students in class today? There are 5 children in the class.

Answers

To represent the 5 children as a computer bit, we make use of the equation 2^b = n. 3 bits are required to represent the 5 children.

Given that

n = 5 ---- number of children

The number of bits (b) is calculated as:

2^b = n

Substitute 5 for n

2^b = 5

Take logarithm of both sides

\log(2)^b = \log(5)

Apply law of logarithm

b * \log(2) = \log(5)

Make b the subject

b = (\log(5))/(\log(2))

b = 2.32

The number of bits must be an integer. So, we use the greatest integer closest to 2.32. The integer is 3

So:

b=3

Hence, the number of bits to represent the 5 children is 3.

Read more about bits at:

brainly.com/question/5046303

What is probably the most revolutionary innovation since the printing press?

Answers

Answer:

The Internet

Explanation:

Why? The internet has done twice if not thrice what the printing press has done. The printing press allowed for dissemination of information and knowledge to the population through its mechanical movable printing capability and speed of book publishing. However its reach was highly limited by the physical attributes of the machines and having to transfer books and papers in spreading them to certain destinations. This limitation has been eliminated by the internet as one is able to receive a book written today in seconds and not physically but through electronic means. In other words, information need not be transferred physically, also accessbility and cost of getting information has been highly improved with the internet.

Translate each statement into a logical expression. Then negate the expression by adding a negation operation to the beginning of the expression. Apply De Morgan's law until each negation operation applies directly to a predicate and then translate the logical expression back into English.Sample question: Some patient was given the placebo and the medication.
∃x (P(x) ∧ D(x))
Negation: ¬∃x (P(x) ∧ D(x))
Applying De Morgan's law: ∀x (¬P(x) ∨ ¬D(x))
English: Every patient was either not given the placebo or not given the medication (or both).
(a) Every patient was given the medication.
(b) Every patient was given the medication or the placebo or both.
(c) There is a patient who took the medication and had migraines.
(d) Every patient who took the placebo had migraines. (Hint: you will need to apply the conditional identity, p → q ≡ ¬p ∨ q.)

Answers

Answer:

P(x): x was given the placebo

D(x): x was given the medication

M(x): x had migraines

Explanation:

(a) Every patient was given the medication

Solution:

∀x D(x)

∀ represents for all and here it represents Every patient. D(x) represents x was given the medication.

Negation:¬∀x D(x).

This is the negation of Every patient was given the medication.

The basic formula for De- Morgan's Law in predicate logic is:

¬(P∨Q)⇔(¬P∧¬Q)

¬(P∧Q)⇔(¬P∨¬Q)

Applying De Morgan's Law:

          ∃x ¬D(x)

represents there exists some. As D(x) represents x was given the medication so negation of D(x) which is ¬D(x) shows x was not given medication. So there exists some patient who was not given the medication.

Logical expression back into English:

There was a patient who was not given the medication.

(b) Every patient was given the medication or the placebo or both.

Solution:

∀x (D(x) ∨ P(x))

∀ represents for all and here it represents Every patient. D(x) represents x was given the medication. P(x) represents  x was given the placebo. V represents Or which shows that every patient was given medication or placebo or both.

Negation: ¬∀x (D(x) ∨ P(x))

This is the negation or false statement of Every patient was given the medication or the placebo or both.

Applying De Morgan's Law:

∃x (¬D(x) ∧ ¬P(x))

represents there exists some. As D(x) represents x was given the medication so negation of D(x) which is ¬D(x) shows x was not given medication. As P(x) represents x was given the placebo so negation of P(x) which is ¬P(x) shows x was not given placebo. So there exists some patient who was neither given medication nor placebo.

Logical expression back into English:

There was a patient who was neither given the medication nor the placebo.

(c) There is a patient who took the medication and had migraines.

Solution:

∃x (D(x) ∧ M(x))

represents there exists some. D(x) represents x was given the medication. M(x) represents x had migraines.  represents and which means patient took medication AND had migraines. So the above logical expression means there exists a patient who took medication and had migraines..

Negation:

¬∃x (D(x) ∧ M(x))

This is the negation or false part of the above logical expression: There is a patient who took the medication and had migraines.

Applying De Morgan's Laws:

∀x (¬D(x) ∨ ¬M(x))

represents for all. As D(x) represents x was given the medication so negation of D(x) which is ¬D(x) shows x was not given medication. As M(x) represents x had migraines so negation of ¬M(x) shows x did not have migraines. represents that patient was not given medication or had migraines or both.

Logical expression back into English:

Every patient was not given the medication or did not have migraines or both.

(d) Every patient who took the placebo had migraines.

Solution:

∀x (P(x) → M(x))

∀ means for all. P(x) represents  x was given the placebo. M(x) represents x had migraines. So the above logical expressions represents that every patient who took the placebo had migraines.

Here we are using conditional identity which is defined as follows:

Conditional identity, p → q ≡ ¬p ∨ q.

Negation:

¬∀x (P(x) → M(x))

¬∀ means not all. P(x) implies M(x). The above expression is the negation of Every patient who took the placebo had migraines. So this negation means that Not every patient who took placebo had migraines.

Applying De Morgan's Law:

∃x (P(x) ∧ ¬M(x))

represents there exists some.  P(x) represents  x was given the placebo. ¬M(x) represents x did not have migraines. So there exists a patient who was given placebo and that patient did not have migraine.

Logical expression back into English:

There is a patient who was given the placebo and did not have migraines.

When you move or size a control in the Form Designer, Visual Studio automatically adjusts the ________________ that specify the location and size of the control.

Answers

Answer:

When you move or size a control in the Form Designer, Visual Studio automatically adjusts the properties that specify the location and size of the control.

The scope of a variable declared inside of a function is:a) Local - within that function

b) Within that file only

c) global

Answers

Answer:

The correct answer for the given question is option(a) i.e Local - within that function.

Explanation:

The variable which is declared inside any function are called as local variable The scope and lifetime of local variable is inside that block or function only.

They cannot access outside the function.

Following are the example of local variable

#include <stdio.h> // header file

void fun(); // function prototype

int main()// main function

{

fun(); //calling function

print("%d",t); // it gives error because t is local variable cannot access in main function

return 0;

}

void fun()

{

int t=9;// local variable

printf("t is local variable which value is:");

printf("%d",t);

}

As we seen that t cannot access outside the function .So correct answer is option(a)

Final answer:

The scope of a variable declared inside of a function is local - within that function. This prevents naming conflicts and ensures control over where a variable can be changed.

Explanation:

The scope of a variable declared inside of a function is typically local to that function. This means that it can only be accessed and manipulated within the function it is declared. It is not visible or accessible from outside of the function or elsewhere in the program file, hence options b) and c) are incorrect. This principle is fundamental in programming languages such as JavaScript, C++, Python, etc., and it is designed this way to prevent naming conflicts and provide control over where a variable can be changed.

Learn more about Variable Scope here:

brainly.com/question/36379699

#SPJ6

Other Questions