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
When Nathanil Inc, a network service provider, introduced 4G data plans, it observed that most of its customers completely stopp
svetoff [14.1K]
We did this at school not hard nor easy it C
6 0
3 years ago
Which of the following best describes cost-benefit analysis?
d1i1m1o1n [39]

Answer:

A

Explanation:

7 0
3 years ago
Assume that the demand curve for DVD players shifts to the left and the supply curve for DVD players shifts to the right, but th
kari74 [83]

Answer:

a.both the equilibrium price and quantity of DVD players will decrease

Explanation:

When the amount required or given varies, even if the price stays the same, a move in the demand or supply curve occurs. Changes in the curve of demand mean that the initial relationship of production has shifted so that demand of quantity has a factor apart from cost influenced

A right shift change of the supply curve shows an increase in supply and, on equal footing, the equilibrium price decreases.

Once the demand curve shifts to the left, the demand decreases.

7 0
3 years ago
Look at the following HTML form. Which description is correct? Please enter your discount code:
jasenka [17]

Answer:

<form action = "discount.php" method = "post" > discount method can be extract from POST method

Explanation:

<form action = "discount.php" method = "post" >

<input type = "text" size = "12" name = "code" >

<input type = "submit" value = "Process" >

</form>

6 0
3 years ago
Which option offers predesiged formatting and design elements to facilitate the process of creating a document?
Mrrafil [7]
Templates......hope this helps you
5 0
3 years ago
Other questions:
  • Lana is trying to insert a table, but she does not like any standard table options that she is given. Which best describes what
    5·2 answers
  • Frank works for an organization that wishes to install a software program on a single server with multiple users connected. Whic
    8·1 answer
  • A proactive computer professional will _____. have a neutral outlook toward technology underestimate the impact of technology an
    13·2 answers
  • In normal view, powerpoint's ________ contains buttons such as notes, comments, and view.
    14·1 answer
  • The purpose of a software design is to enable programmers to implement the requirements by designating the projected parts of th
    14·1 answer
  • When are bar charts most commonly used
    10·1 answer
  • Consider a system running ten I/O-bound tasks and one CPU-bound task. Assume that the I/O-bound tasks issue an I/O operation onc
    14·1 answer
  • To insert text from a separate file into your Word document
    10·1 answer
  • Dgvdsgf cvdzgb fgvsdxchygfdrzvdszfgvsdzxd
    9·1 answer
  • Does every loop structure require curly braces?<br> A. yes<br> B. no
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!