subject

You will need to create your own implementation of the Student class. It will look much like the Student class we saw in the class PowerPoint slides. You may take some shortcuts though. Knowing that the data will always be sets of four lines of text which contain a student name and three scores, you can get away with a constructor that takes the name and three scores and creates the instance of the Student object. (You will still need to get the data out of it though, so don’t forget those methods.) Also, given that you will be reading the number of students in the “class group” as the first item of data read from the file, you can allocate the array to hold the students in the program. After that you can read the data in groups of four lines, to get the complete set of data for each student, and create a new memory space for that data in your array. Description

Here is a sample interaction between a user and the program you will write in the exercise. (User input is in bold.)

Enter file name: c:\\info. txt

Name Score1 Score2 Score3 Total

Andy Borders 200 250 400 850
John Smith 120 220 330 670
John Borell 250 250 500 1000
Robert Fennel 200 150 350 700
Craig Fenner 230 220 480 930
Bill Johnson 120 150 220 490
Brent Garland 220 240 350 810

The total number of student in this class is: 7
The average total score of the class is: 778
John Borell got the maximum score of: 1000
Bill Johnson got the minimum score of: 490


Note that the filename supplied includes the full path. Specify a full path or the IDE will not find the file.

The program performs the following actions:

1. Ask the user for the name of a file containing information about student scores and input the file name. (See “Input file format” for a description of the format of the file.)
2. Input the student information from the file and store in an appropriate array of Student objects. See “Setup” for a description of this.
3. Output a well-formatted table containing the name, individual scores and total score for each student.
4. Output the number of students in the class, the average total score, the maximum total score and the minimum total score in the class, including the names of the students with the maximum and minimum scores.

To tabulate the output, you can count spaces or use tab characters. A tab character can be printed by using the ’\t’ escape sequence. For example, System. out. print(”1\t2\t3”) will output something like “1 2 3” where 1, 2 and 3 are separated by tabs.

Input file format

The input file will contain information about student scores in the following format:

…

The first line, , contains the number of students in the input file, is a string representing a student name, and , and are integers (which you will read as Strings and convert to numbers) representing the three student scores. See info. txt for a sample input file in this format. Note that your solution must work with an input file following this format, but with an arbitrary number of student records—make sure your program is not hard-coded to read in 7 students.

If you look at this file on a PC, it may look like one single, long line. Don't worry about that. There are non-printing (invisible on the display) characters in the file that Java will use to tell one line from another.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 16:00
What is the biggest difference between section breaks and regular page breaks? section breaks are more difficult to add than page breaks. section breaks make it easier for you to view the document as an outline. section breaks allow you to have areas of the document with different formatting. section breaks are smaller than regular page breaks.
Answers: 2
question
Computers and Technology, 23.06.2019 20:30
What is the biggest difference between section breaks and regular page breaks
Answers: 1
question
Computers and Technology, 24.06.2019 14:00
In simple terms, how would you define a protocol?
Answers: 2
question
Computers and Technology, 24.06.2019 23:00
The valves of the heart and veins are similar in that they both
Answers: 1
You know the right answer?
You will need to create your own implementation of the Student class. It will look much like the Stu...
Questions
question
Spanish, 11.03.2020 16:01
question
Mathematics, 11.03.2020 16:02