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
How do we benefit from this increased interconnectivity?
ankoles [38]
Well we just benefit from it like it just helps as I guess
8 0
2 years ago
A Transmission Control Protocol (TCP) connection is established and two devices ensure that they're speaking the same protocol.
son4ous [18]

Answer:

The answer is "Three-way handshake".

Explanation:

In this mechanism, two processes associated with communication throughout SEO techniques. In this, the sequence of data packets and recognized by the number of exchanges during the threefold handshake process.

  • This method initiating the process between two apps,  Handshaking begins whenever a computer sends the message to its system.
  • The process of the communication system has been established into the two devices,  which simply send many messages, which allow them to settle the protocol for communication.
6 0
3 years ago
From what tab can you format individual cell data like any other text?
Readme [11.4K]
I think the answer is D
5 0
3 years ago
A(n) _____ is a Web address that specifies the exact location of a Web page using letters and words
Ahat [919]
A Uniform Resource Locator (URL)
5 0
3 years ago
John just bought a used iPad from a friend who had lost the charging cable. John notices that the cable is like the charging cab
7nadin3 [17]

Answer:

an iphone charger

Explanation:

5 0
3 years ago
Other questions:
  • How do you find the exterior angle measure of any regular polygon? (The degree in which to turn the turtle to draw a shape)
    10·1 answer
  • Which of the following is an example of tangible property?
    5·1 answer
  • Haley is responsible for checking the web server utilization. Which things should she review while checking the server utilizati
    8·2 answers
  • 54 points!!! Cyber security
    14·1 answer
  • Write a function longer_string() with two string input parameters that returns the string that has more characters in it. If the
    5·1 answer
  • Please help with coding assignment.
    11·1 answer
  • If, after fetching a value from memory, we discover that the system has returned only half of the bits that we expected; it is l
    8·1 answer
  • If you added the formula =SUM(B1:B5) to a spreadsheet, what would it do?
    10·1 answer
  • Which of the following protocols is used by an email client to retrieve messages from an email server, giving users the option t
    11·1 answer
  • Identify three errors in this HTML code snippet:
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!