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 cold, hard facts support your position?
Sladkaya [172]
Idk what is it?
a computer?
plz mark me as brainliest
6 0
3 years ago
________ is a markup language that allows for tagging selected elements of the content of documents for their meanings and is us
trasher [3.6K]

Answer:

E)nXML

Explanation:

XML is a short for Extensible Markup Language. It is a markup language like the Hypertext markup language (HTML) and are both used in the development of web applications. However while the HTML describes the content of the Web page that is the graphics, images and videos and how they are displayed, the XML handles the description of data and information formats, their storage and the transportation and sharing over the internet.

4 0
3 years ago
Read 2 more answers
Help a fellow coder and anser these 5 questions
BlackZzzverrR [31]

Answer: yes because it helps

Explanation: it shows everything

4 0
3 years ago
It is important organic mineral that is found in the soil as ash​
loris [4]

Answer:

Calcium is the most abundant element in wood ash and gives ash properties similar to agricultural lime. Ash is also a good source of potassium, phosphorus, and magnesium.

7 0
2 years ago
Read 2 more answers
Which of the following is not an interconnector?
igor_vitrenko [27]

The following is not an interconnector :

A wireless keyboard jack

Explanation:

  • An interconnector is a structure which enables energy to flow between networks.
  • An electrical or optical connection or cable that connects two separate devices.
  • Since a wireless device does not have a cable connecting the two, they are not an interconnector.
  • The cable that connects your monitor or hard drive to the computer system is called an interconnect.
  • Switches can be used to connect together a number of end-user devices such as workstations, or to interconnect multiple network segments.
  • A standard computer system will contain multiple interconnects.
3 0
3 years ago
Other questions:
  • Pascal's Triangle is a triangular array in which every number represents the
    15·1 answer
  • I’m nobody. Who are you?
    9·2 answers
  • Ted has $55.00 in his pocket. Which purchase will he be able to pay for with cash?
    9·2 answers
  • What is one method that can be used to open the Microsoft Word application?
    8·1 answer
  • Write a program that accepts a positive integer N as command-line argument, and outputs True if N is the square of some integer,
    13·1 answer
  • Identify a true statement about heuristics: a. They are more complicated than algorithms. b. Unlike algorithms, they do not perm
    15·1 answer
  • How are comments in a Java program treated by the compiler?
    14·2 answers
  • A disk drive has 2000 cylinders, numbered 0 to 1999. The drive is currently servicing a request at cylinder 783, with the previo
    6·1 answer
  • 1.<br> _g<br> clue: fret; become worried<br> 2.<br> Fret become worried
    10·1 answer
  • les agrees to install a new hard drive and software on marilee's computer in exchange for four of her used textbooks. after he i
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!