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]
4 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]4 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
Every time attribute A appears, it is matched with the same value of attribute B, but not the same value of attribute C. Therefo
Olegator [25]

Answer:

A,B

Explanation:

It is A,B because therefore it is true A,B if attribute A determines both attribute B and C, A,B if attribute A and B determine attribute C, A,B is a composite determinant.

4 0
3 years ago
A software program installed without the user's knowledge and designed to alter the way a computer operates or to cause harm to
RSB [31]

Answer:

The correct answer for the given question is "Computer virus"

Explanation:

A computer virus is a software program that is installed automatically without user's knowledge and designed to duplicate itself .The main purpose of computer virus is to harm the computer system.

Some of the points regarding computer virus

1.The computer virus contain malicious software Which harm the computer system.

2.It damage the  computer computer system in such away that sometimes users will unable to access some certain functionality of computer system.

5 0
3 years ago
In DTP, a good rule of thumb is to use as many special effects as you need to make your documents look interesting.
Margarita [4]
It all depends back on who youre present it t

younger ages (Primary-Middle),
Its Ok to use plenty of special effects, but dont ovedue your DTP with effects, so that they still can get the point.

Older ages (High & above)
Older people usually more serious than older ages to pursue their careers, so less effect, more points


5 0
3 years ago
Name three technologies that begin with the same letter of the alphabet
qaws [65]
Active-Matrix 
Applet
ATM
8 0
4 years ago
Read 2 more answers
Binary is used to store what on a computer?<br> •Data<br> •Dates<br> •Address
solmaris [256]

Answer:

Data................

5 0
3 years ago
Read 2 more answers
Other questions:
  • Many people blame online shopping for the demise of the high street. Discuss why high street shops find it difficult to compete
    12·1 answer
  • 18. Which type of briefing is delivered to individual resources or crews who are assigned to operational tasks and/or work at or
    14·1 answer
  • How can you put a video on powerpoint?
    14·2 answers
  • Keyshia now wants to remove the background of the image. She marks the areas she wants to keep and the areas she wants to remove
    13·2 answers
  • When deciding how to invest your money, which of the following is least important to know
    7·1 answer
  • How can these requirements be met? Universal Containers conduct evaluations of their sales reps using a custom object consisting
    10·1 answer
  • What computing platform was designed to help a beginner create interactive objects that receive input from sensors and use that
    11·1 answer
  • 2. How is accessing the Internet through a home network and public Wi-Fi similar?​
    15·1 answer
  • 1. It is a set of integrated devices that input, output,
    11·1 answer
  • Create a new Java class called AverageWeight. Create two arrays: an array to hold 3 different names and an array to hold their w
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!