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
Lelechka [254]
3 years ago
12

Test Average and Grade

Computers and Technology
1 answer:
sladkih [1.3K]3 years ago
8 0

Answer:

import java.util.Scanner;

public class TestAveGrade

{

public static void main(String[] args) {

 Scanner scanner = new Scanner( System.in );

       double userScore1, userScore2, userScore3, userScore4, userScore5;

       

       System.out.print ("Enter test grade for student1:");

       userScore1 = scanner.nextDouble();

       System.out.print ("Enter test grade for student2:");

       userScore2 = scanner.nextDouble();

       System.out.print ("Enter test grade for student3:");

       userScore3 = scanner.nextDouble();

       System.out.print ("Enter test grade for student4:");

       userScore4 = scanner.nextDouble();

       System.out.print ("Enter test grade for student5:");

       userScore5 = scanner.nextDouble();

       

       System.out.println("The letter grades are as follows:");

       System.out.println("Student-1: " + determineGrade(userScore1));

       System.out.println("Student-2: " + determineGrade(userScore2));

       System.out.println("Student-3: " + determineGrade(userScore3));

       System.out.println("Student-4: " + determineGrade(userScore4));

       System.out.println("Student-5: " + determineGrade(userScore5));

           

       System.out.printf("The average grade was: %.2f", calcAverage (userScore1, userScore2, userScore3, userScore4, userScore5));

}

public static double calcAverage(double userScore1, double userScore2, double userScore3, double userScore4, double userScore5){

       double average;

       average = (userScore1 +userScore2 +userScore3 +userScore4 +userScore5) /5;

       return average;

   }

   public static String determineGrade(double testScore){

       String letterGrade = " ";

       if (testScore < 60){

           letterGrade = "F";

       }

       else if (testScore <70) {

           letterGrade = "D";

       }

       else if (testScore <80) {

           letterGrade = "C";

       }

       else if (testScore <90) {

           letterGrade = "B";

       }

       else if (testScore <100) {

           letterGrade = "A";

       }

       return letterGrade;

   }

}

Explanation:

Hi, I modified your code. Your methods work but you need to update the main.

Ask the user to enter five grades and store the values in different variables

Call the determineGrade method passing each grade as a parameter

Call the calcAverage method passing all the grades as parameter

You might be interested in
What additive keeps engines clean by preventing contaminates and deposits from collecting on surfaces? a. Friction modifiers b.
White raven [17]

Answer is: Dispersants


Explanation:

Dispersants keep contaminants (e.g. soot) suspended in the oil to prevent them from coagulating. Anti-foam agents inhibit the production of air bubbles and foam in the oil which can cause a loss of lubrication, pitting, and corrosion where entrained air and combustion gases contact metal surfaces.

So that's why the answer is: Dispersants

7 0
3 years ago
Read 2 more answers
Chat messages are most likely to be found where on a computer? firewall nic internet history ram
miv72 [106K]
<span>The answer is RAM.  Chat messages are most likely to be found in the RAM of the computer.  It is Random Access Memory.  </span><span>RAM is considered volatile memory, which means that the stored information is lost when there is no more power.</span>
3 0
2 years ago
Computer spreadsheet is a grid of​
Kruka [31]
Huh we’re, we’re is the computer screen shot
3 0
2 years ago
After purchasing new computers for her​ department, a manager is now comparing the performance of the new computers to the compu
AlladinOne [14]

Answer:

evaluation of decision effectiveness

Explanation:

Based on the information provided within the question it can be said that in this scenario she is in the stage of evaluation of decision effectiveness. This is the stage after the decision has been made in which the individual begins to analyze the decision and determine whether the decision was as effective as originally anticipated , and whether or not it was the correct decision.

8 0
3 years ago
Your company has merged with another company that also uses Windows Server 2016 and Active Directory. You want to give the other
LiRa [457]

Answer:Creation of two-way forest trust

Explanation: In active directory, Two way forest trusty is the two way trusting condition where one forest trust the other forest and it works same for both forest.The forest domain of one forest is reliable and have trusty relationship with the other forest and vice-versa.

This function of the forest helps all the users to reliably access all the components of both the domains.Thus two-way forest trust should be created between the two organization mentioned in the question.

5 0
3 years ago
Other questions:
  • Which method do software testers use to isolate new code from the rest of the network during the test stage of the software deve
    15·1 answer
  • Repl.it Assignment 4.1.2 (Guess the Number)<br> Please help me<br> I will give brainliest and a like
    10·1 answer
  • . _______ are used to categorize information found on the web
    13·1 answer
  • Which of the following countries have mixed-market economy
    5·1 answer
  • Several NEC® sections contain the requirement to size conductors and overcurrent devices at 100 percent of the noncontinuous loa
    15·1 answer
  • What did Adam and Eve look like?
    7·2 answers
  • Why it is not recommended to add sound effect on slide transition? Write at least two reasons.​
    6·1 answer
  • What are the pros and cons of being a single decision maker
    8·1 answer
  • Has replaced the need for landline telephones in many instance​
    10·1 answer
  • What does data warehousing allow organizations to achieve?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!