1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
solong [7]
3 years ago
9

Write a program that determines a student's letter grade. Allow the user to enter three test scores. The maximum score on each t

est is 100 points. Determine the letter grade from the average of the test scores, using the following: 90% or more A 80% or more, but less than 90% B 70% or more, but less than 80% C 60% or more, but less than 70% D or F, to be determined from additional information less than 60% F Only if the grade needs to be determined between D and F, allow the user to enter the number of homework assignments the student turned in, and the total number of homework assignments. If more than 80% of the homework assignments were turned in, the letter grade is D, otherwise F. Test it 4 times: 96 84 90 95 83 90 70 59 60 with 5 homework out of 6 turned in 73 58 65 with 8 homework out of 11 turned in Compute the results by hand and check your results.
Computers and Technology
1 answer:
Elina [12.6K]3 years ago
6 0

Answer:

public class Grade {

   

   public static void main (String [] args) {

       

       int sum = 0, avg = 0;

       char grade = 'x';

       Scanner input = new Scanner(System.in);

       

       System.out.print("Enter the test scores: ");

       for(int i=1; i<=3; i++) {

           int testScore = input.nextInt();

           sum += testScore;

       }

       

       avg = sum/3;

       

       if(avg >= 90) {

          grade = 'A';

       }

       else if(avg>= 80 && avg < 90) {

          grade = 'B';

       }

       else if(avg>= 70 && avg < 80) {

          grade = 'C';

       }

       else if(avg>= 60 && avg < 70) {

         

          System.out.print("Enter the number of homeworks turned in: ");

          int homeworksTurnedIn = input.nextInt();

          System.out.print("Enter the total number of homeworks: ");

          int totalHomeworks = input.nextInt();

         

          if((homeworksTurnedIn / (double)totalHomeworks) > 0.8) {

              grade = 'D';

          }

          else

              grade = 'F';

       }

       else if(avg < 60) {

          grade = 'F';

       }

       

       System.out.println("Your grade is: " + grade);

   }

}

Explanation:

- Initialize the variables

- Ask the user for the test scores

- Inside the for loop, calculate the <em>sum</em> of the test scores

- Then, find the <em>average</em> of the scores

- Depending on the <em>average</em>, print the <em>grade</em>

You might be interested in
An effective problem statement ensures that
swat32
The software design effectively addresses the issues
6 0
3 years ago
Michael is stuck due to an electric shock generated at the fridge. What should you do to save michael?.
NISA [10]

Pull him away from the fridge with a non-conducting material and begin cardiopulmonary resuscitation .

<h3>What is meant by electric shock?</h3>

When a human comes into contact with an electrical energy source, they experience an electric shock. A shock is produced when electrical energy passes through a section of the body. Exposure to electrical energy has the potential to cause fatalities or absolutely no injuries.

The tangible and tangible result of an electrical current entering the body is electrical shock. The shock could be anything from a dangerous discharge from a power line to an uncomfortable but safe jolt of static electricity after walking over a thick carpet on a dry day. trauma; related topics.

The complete question is : Michael is stuck due to an electric shock generated at the fridge. What should you do to save Michael?

A. push the fridge away with a non-conducting material and begin cardiopulmonary resuscitation

B. push the fridge away from him and begin cardiopulmonary resuscitation

C. pull him away from the fridge with a non-conducting material and begin cardiopulmonary resuscitation

D .pull him away from the fridge with your hands and begin cardiopulmonary resuscitation

To learn more about electric shock refer to:

brainly.com/question/28361869

#SPJ1

7 0
1 year ago
Help me
denis23 [38]

Answer:

a = 6, b = 0

Explanation:

The loop ran 3 times before b == 0. "while ((b != 0)" is essentially saying: 'While b is not equal to 0, do what's in my loop'. Same general thing with "&& ((a / b) >= 0)". The "&&" is specifying that there should be another loop condition, while the rest states: 'as long as a ÷ b is greater than 0, do what's in my loop'. If both of these conditions are met, the loop will run, It will continue this until the conditions are not met. Hope that helped! :)

7 0
2 years ago
The ____ option must be used when running a program in order to see the results of assert statements.
Lera25 [3.4K]

Answer:

-ea

Explanation:

We can enable or disable assertions in java, by default this assertions are disabled at runtime, but we can use two commands, for example, if we want to enable assertions at various granularities, we can use the -enableassertions, or -ea, switch, if we want to disable at various granularities, is -disableassertions, or -da.

4 0
3 years ago
You can perform numbers___on binary
Masja [62]

Answer:

c) arithmetic operations

3 0
3 years ago
Read 2 more answers
Other questions:
  • A patent facilitates a government-approved technological monopoly by
    5·1 answer
  • ________ symbol is used in the "Advanced" section of the time range picker to round down to nearest unit of specified time.
    8·1 answer
  • An information- and communication-based electronic exchange environment mostly occupied by sophisticated computer and telecommun
    13·1 answer
  • Some of the more important __________ include anti-virus (and anti-malware), host-based firewall, system hardening (removing unw
    11·1 answer
  • With a web app, much of the program code for the software runs locally on a computer, instead of running on a remote computer co
    13·1 answer
  • If you design your pages using a font that your user does not have installed, the browser defaults to ____ on a macintosh.
    13·1 answer
  • You are trying to log in to your old computer, and can't remember the password. You sit for hours making random guesses... I'm s
    10·1 answer
  • (10 points) A stopwatch has three states named Zero, Running, and Stopped. There are two buttons, named B1 and B2. For each butt
    13·1 answer
  • Hello my name is Phoenix I will like for you to friend me on Ro blox my user name is Jessiahcoleman and if u play BLOX fruits or
    13·1 answer
  • The Power of If Worksheet
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!