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
Alexxandr [17]
3 years ago
13

Write the class "Tests". Ensure that it stores a student’s first name, last name, all five test scores, the average of those 5 t

ests’ scores and their final letter grade. (Use an array to store all test scores.)
Computers and Technology
1 answer:
zhannawk [14.2K]3 years ago
7 0

Answer:

The following assumption will be made for this assignment;

  • If average score is greater than 75, the letter grade is A
  • If average score is between 66 and 75, the letter grade is B
  • If average score is between 56 and 65, the letter grade is C
  • If average score is between 46 and 55, the letter grade is D
  • If average score is between 40 and 45, the letter grade is E
  • If average score is lesser than 40, the letter grade is F

The program is written in Java and it uses comments to explain difficult lines. The program is as follows

import java.util.*;

public class Tests

{

public static void main(String [] args)

{

 //Declare variables

 Scanner input = new Scanner(System.in);

 String firstname, lastname;

 //Prompt user for name

 System.out.print("Enter Lastname: ");

 lastname = input.next();

 System.out.print("Enter Firstname: ");

 firstname = input.next();

 char grade;

 //Declare Array

 int[] Scores = new int[5];

 //Initialize total scores to 0

 int total = 0;  

  //Decalare Average

  double   average;

 //Prompt user for scores

 for(int i =0;i<5;i++)

 {

  System.out.print("Enter Score "+(i+1)+": ");

  Scores[i] = input.nextInt();

  //Calculate Total Scores

  total+=Scores[i];

 }

 //Calculate Average

 average = total/5.0;

 //Get Letter Grade

 if(average>75)

 {

 grade = 'A';

 }

 else if(average>65)

 {

 grade = 'B';

 }

 else if(average>55)

 {

 grade = 'C';

 }

 else if(average>45)

 {

 grade = 'D';

 }

 else if(average>40)

 {

 grade = 'E';

 }

 else

 {

 grade = 'F';

 }

 //Print Student Results

 System.out.print("Fullname: "+lastname+", "+firstname);

 System.out.print('\n');

 System.out.print("Total Scores: "+total);

 System.out.print('\n');

 System.out.print("Average Scores: "+average);

 System.out.print('\n');

 System.out.print("Grade: "+grade);

}

}

See Attachment for .java file

Download java
You might be interested in
What should you do if the drive on which you want to install windows server 2012 already has a partition on it containing an ope
Alinara [238K]
Delete those partitions and reformat the drive.
4 0
3 years ago
Communication among office computers is based on a protocol that uses CRC-32 for error detection. A series of 100 identical test
Fiesta28 [93]
I think it is the CRC-32 for error detection
4 0
2 years ago
You should always buy the biggest camera bag that you can find for extra equipment.
Akimi4 [234]

Answer:

true

Explanation:

7 0
3 years ago
Read 2 more answers
PLS HELP I GOT 30 MINS TO TURN THIS IN!!!
tekilochka [14]

Answer:

it is actually a phone video gaming tv and stuff that you play with like cars and other stuff

Explanation:

4 0
2 years ago
Read 2 more answers
All 802.11 standards use ______________ signaling, meaning a wireless station can only transmit or receive, but cannot do both s
sasho [114]
The answer that best fits the blank would be the term HALF-DUPLEX. Half-duplex in all 802.11 standards, is being used in signaling, which means that a wireless station can channel or also receive, but cannot be done all at once. 
3 0
3 years ago
Other questions:
  • When would you use an omnidirectional microphone?
    9·1 answer
  • What is encyclopedia. Com considered to be?
    14·1 answer
  • Which online resource is usually not free?
    10·2 answers
  • Your company has merged with another company that also uses Windows Server 2016 and Active Directory. You want to give the other
    6·1 answer
  • Compare and contrast the role that business users play when software is developed using Waterfall and Agile software development
    10·1 answer
  • True or False: <br> The object reference can be used to polymorphically store any class in Java.
    13·1 answer
  • How many bytes are there in 256 Kbytes?
    6·1 answer
  • I need help, who is a great phone pin lock screen cracker?
    9·1 answer
  • The _____ of a story describes the time and location of a story.
    5·2 answers
  • Explain how communication facilitate cordination​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!