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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 21:30, karleebowling316
Asuccessful format string attack attempted to steal user account information by reading from unauthorized memory. answer the followings with proper explanation a)this attack will lead to violation of which security policies?
Answers: 2
image
Computers and Technology, 21.06.2019 23:00, zahraa244
Describe in pseudocode an algorithm that given an integer n and a linked list of elements increases the linked list by a factor of n by replacing each element in the original list with n copies of that element. for example, if l: [18, 7, 4, 24, 11] and n = 3 the resulting list should be l: [18, 18, 18, 7, 7, 7, 4, 4, 4, 24, 24, 24, 11, 11, 11]. if the value of n is less than or equal to 0, the list should be empty after the call. what’s the running time of your algorithm?
Answers: 3
image
Computers and Technology, 22.06.2019 00:20, orlando19882000
The pyraminx is a rubik's cube-type toy in the shape of a tetrahedron (not a pyramid). the pyraminx shown below has edges 15\,\text{cm}15cm15, space, c, m long and vertical height h=12.2\,\text{cm}h=12.2cmh, equals, 12, point, 2, space, c, m. the triangle drawn with dashed lines is a right triangle. what is the distance rrr? round your answer to the nearest tenth.
Answers: 1
image
Computers and Technology, 22.06.2019 09:00, jgrable5175
Designing a mobile web page is a little different from designing a regular web page. name at least three features that should be considered when designing a website that is mobile phone-friendly, and briefly explain why they are important.
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 in other subjects:

Konu
Mathematics, 25.03.2020 21:48
Konu
History, 25.03.2020 21:48