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
Cuántos tipos de grua existen en el mundo​
natka813 [3]
Grúas semi pórtico, carretilla pórtico, side lifter, grúas torre, grúas puente, grúas flotantes... y mas
Espero q esto te ayude! :))
3 0
3 years ago
Briefly explain the following terms and concepts:
morpeh [17]

Answer:

Answer below

Explanation:

Maximum transmission unit (MTU)

A maximum transmission unit (MTU) is the largest packet or frame size that is usually specified in Eight-bit bytes, which can be sent in a packet or frame-based network such as the internet.  

Longest Prefix Match

Longest prefix match is an algorithm used by routers in Internet Protocol to lookup the IP prefix that will likely be the terminal point of the next hop from the router.

CIDR and Subnet Mask

CIDR, known in full as Classless inter-domain routing, is a set of IP standards that is used to make customized identifiers for networks and individual devices.  

A subnet mask separates the internet protocol (IP) address into the network address and host address.

 

Switching Fabric

Switching fabric is simply an arrangement of the elements of a communication network also known as network topology, whereby the nodes of the network are seen to interconnect with one or more network switches.

7 0
3 years ago
Read 2 more answers
Pleasee help meeeeeeeeee I’m stuckk!!!!
Anit [1.1K]

Answer: Charles Babbage

4 0
2 years ago
Read 2 more answers
Imagine that you are a professional white hat hacker, testing a company’s system to make sure they are ready for attacks. What m
liberstina [14]

Answer:

A white hat hacker, or ethical hacker, uses penetration testing techniques to test an organization's information technology

Explanation:

3 0
2 years ago
A security utility program that scans the system for small programs that interfere with how a computer functions are _____ utili
Aneli [31]

Answer:

A security utility program that scans the system for small programs that interfere with how a computer functions are _____ utilities.

Explanation:

7 0
3 years ago
Other questions:
  • Jane is a postproduction crewmember for a film. Her responsibilities include arranging all the scenes that have been shot into t
    7·1 answer
  • True / False<br> Registers are generally optimized for capacity instead of speed.
    14·1 answer
  • Question 14. (3.04 MC) how does the project manager evaluate the scope of a project
    14·1 answer
  • This type of method method performs a task and sends a value back to the code that called it:
    5·1 answer
  • List the gcc command-line options for each of the following: Generate a .o file rather than an executable. Generate a .s (assemb
    6·1 answer
  • Which part of the operating system enables you to interact with the device? Question 9 options: The graphical user interface The
    8·1 answer
  • PLEASE HELP ASAP!!! 99 POINTS FOR 3 MULTIPLE CHOICE QUESTIONS!!! PLEASE ANSWER ALL!!!
    8·1 answer
  • Write a program to generate a square wave with 80% duty cycle on bit P2.7 Microprocessor.​
    7·1 answer
  • the front desk of the Nocete's Hotel will comlute the total room sales (TRS) of Room 101.The room was occupied three times and t
    6·1 answer
  • What is the difference between php and html?​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!