Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Help! I am stuck with this assignment. Please help me..........! Test Scores Pro

ID: 3641560 • Letter: H

Question

Help! I am stuck with this assignment. Please help me..........!

Test Scores Program

This is a console-based program that is an exercise in loops and arrays. The program has two arrays: an array of Strings that holds the names of six students, and an integer array that will hold the test score for each of those students. These will be used as "parallel arrays", which means that we will "line up" the indices of the array (i.e., if "Ian" is at index 0 of the names array, then Ian's score is held at index 0 of the scores array, and since "Bette" is an index 1 of the names array, then her test score is at index 1 of the scores array, etc.).

Start with the code shown below, then add your own code. You must write a separate loop for each of the five sections shown below. Therefore, when you submit the program you will have five separate loops in your solution. The loops that you will write will do the following:

Read in the test score for each student.
Calculate and report the average test score.
Report the number of students who got an "A" on the test.
Report all of the students and their test scores -- put a "*" next to those scores that are 90 or greater.
Report the grade earned by each student.

Start With This Code

import java.util.*;

/*

Even though it is possible to write most of this program with just one giant
loop at the top of the program, you MUST write a separate loop for each
section of the program shown below. Therefore, you will in the end have
FIVE separate loops written below.

*/

public class TestScores
{
public static void main(String [] args)
{
String [] names = { "Ian", "Bette", "Bill", "Carla", "Alan", "John" };
int [] scores = new int[ names.length ];

System.out.println("TEST SCORE PROGRAM");

// Write a loop to ask for the test score for each person, and
// store that person's score in the "scores" array.

Scanner scan = new Scanner(System.in);





// Write a loop to calculate and print the average score.

double average;





// Write a loop to count the number of people who got an "A"
// with a score of 90 or more.

int numAs = 0;





// Write a loop that prints every person and their score. Put
// a "*" next to anyone who has a score of 90 or more.

System.out.println(" Scores: ");





// Write a loop to report the grades.

System.out.println(" Grades: ");




}
}

Sample Run of the Program

In the run shown below, the user types in the test scores when prompted by the program (indicated in bold letters, below). The program prints all of the other output shown below:

TEST SCORE PROGRAM
Enter the score for Ian: 88
Enter the score for Bette: 99
Enter the score for Bill: 95
Enter the score for Carla: 70
Enter the score for Alan: 35
Enter the score for John: 90

Average test score was 79.5

There were 3 tests that earned an "A"

Scores:
Ian 88
Bette 99 *
Bill 95 *
Carla 70
Alan 35
John 90 *

Grades:
Ian B
Bette A
Bill A
Carla C
Alan F
John A

The program should run successfully for any test scores entered by the user (not just for the scores shown above). You can assume that the user will type in scores between 0 and 100 -- you do not have to do any error checking on the numbers entered by the user.
Other Requirements

Use good programming style, as described briefly in A Short Summary Of Style and in more detail in Programming Style.
Submit TestScores.java file to the Blackboard web site.

Screen Shot of the Sample Run

Explanation / Answer

//NOTE - Please note that this program will not give you the exact grades as you //asked. TO MAKE IT GIVE THE PROPER GRADES, have a look at the code at the //bottom. All you need to do is change the numbers inside the various if(). The code //works ! YOU SHOULD HAVE MENTIONED HOW STUDENTS GET THEIR GRADES BASED //ON THEIR POINTS. import java.util.*; public class TestScores { public static void main(String [] args) { String [] names = { "Ian", "Bette", "Bill", "Carla", "Alan", "John" }; int [] scores = new int[ names.length ]; System.out.println("TEST SCORE PROGRAM"); // Write a loop to ask for the test score for each person, and // store that person's score in the "scores" array. Scanner scan = new Scanner(System.in); for(int i =0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote