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
Use the drop-down menus to complete statements about back-up data files.
vlada-n [284]

Answer:

the third one trust me

Explanation:

5 0
3 years ago
Read 2 more answers
What does the measurement tell you?<br><br> Schedule performance index
Natasha_Volkova [10]

Answer:

how close the project is to being completed compared to the schedule/ how far ahead or behind schedule the project is, relative to the overall project

Explanation:

3 0
3 years ago
Suppose a JPanel with a BorderLayout manager contains two components: component1, which was added to the EAST, and component2, w
Tamiku [17]

Answer:

b) I, II, III

Explanation:

Since the two components are added to the 'east' and 'west', and the JPanel has a BorderLayout manager, then North, South and Center parts of the JPanel will appear.

3 0
3 years ago
Select the correct text in the passage.
Len [333]

Answer:

The appropriate guidelines to create and manage files in the passage:

O.  First, (select a central location to organize all your files, folders, and sub-folders).

O.  Then double-click the folder or folders to identify which file you want to move.

O.   Now (use Windows Explorer to navigate and paste the file in the

required location).

The correct text in the passage is:

O.   It is a great idea to (categorize your data into folders.) It is even better to (segregate them further into sub-folders.) If you maintain a list of  sub-folders under every main folder, you will be able to access all your tasks easily. For example, you could put your school subjects under  different sub-folders to organize your data efficiently on your computer.

Explanation:

8 0
3 years ago
E-banking is also called: [1]
DENIUS [597]
Answer 1 it’s online banking
3 0
3 years ago
Other questions:
  • Determine the number of bytes necessary to store an uncompressed binary image of size 4000 × 3000 pixels.
    9·1 answer
  • A rectangular box that displays information or a program is called
    13·1 answer
  • Businesses finance their operations using a mixture of ______. debt,
    14·1 answer
  • Write a recursive method called repeat that accepts a string s and an integer n as parameters and that returns s concatenated to
    7·1 answer
  • Create a project named ClassicBookSelector that contains a Form with a ListBox that lists at least five classic books that you t
    10·1 answer
  • 4. You are planning to buy a new couch for your family room. Before you leave for the furniture store, you measure the available
    11·1 answer
  • The ________ utility automatically creates duplicates of your libraries, desktops, contacts, and favorites to another storage lo
    6·1 answer
  • Write any three type of looping structure with syntax​
    13·1 answer
  • The technology dealing with robots is called
    6·1 answer
  • D) Software which is basically language translation software.​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!