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
# 12/9/2020
EastWind [94]

where it says   " def main() " there needs to be something in the "()"

Hope this helps.   : )

3 0
3 years ago
How does technology influence the development of personal and public identity?
Marysya12 [62]

Answer:

Technology affects the way individuals communicate, learn, and think. It helps society and determines how people interact with each other on a daily basis. Technology plays an important role in society today. It has positive and negative effects on the world and it impacts daily lives.

Hope it's helpful to u

6 0
3 years ago
A Uniform Resource Locator (URL) is a formatted string of text that web browsers, email applications, and other software program
Fiesta28 [93]

The purpose of a URL is to help users get to websites easier. A URL (Uniform resource locator) is that tab at the top of your web browser that you type into. Like if you want to go to google, you would type in Google.com. So the answer is true.

6 0
3 years ago
Read 2 more answers
What are the factors that influence the selection of access control software and/ or hardware? Discuss all aspects of access con
skelet666 [1.2K]

Answer:

While selecting the access control system (software or hardware), there are many factors that influence it and those factors are campus location, network capabilities, number of users using it, size of campus, the motive for using it, etc.

Explanation:

The access control system is electronic device that needs to be connected to the network for providing security control and authorization to the user to enter into the Campus.  

Access control systems are used to control access into premises or any IT area which is control in two ways either in a physical way or a logical way.

8 0
3 years ago
If you type =5*3 into a cell, what do you expect the answer will be?
Ilya [14]

Answer:

I think 15

what do you mean by cell

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • Which line of code will generate a random integer between 7 and 77?
    10·1 answer
  • b. Suppose instead that Miller had written a routine to constantly change his assigned IP address to other addresses used by his
    8·1 answer
  • : Each individual data items of record is called a
    7·1 answer
  • What step can Miguel take to solve his dilemma? Miguel is working on a project that requires him to switch back and forth freque
    12·2 answers
  • Which statement accurately compares the restart at 1 and continue numbering featured of word
    15·2 answers
  • Why is it important to evaluate the website on which you plan to shop?
    7·2 answers
  • Create a program in Python that prompts the user to enter an integer number within the range of 1 to 10 inclusive. The program s
    15·2 answers
  • What do you mean by GIGO (Garbage-In-Garbage-Out) in computer system?​
    6·1 answer
  • Please answer fast..​
    15·1 answer
  • 2) Please create a C program for the following: (25 points) a. Suppose the US dollar to Korean Won is 0.85 dollars to 1000 won.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!