kristen17diaz
28.11.2020 •
Computers and Technology
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.
Solved
Show answers
More tips
- F Food and Cooking 10 Tips for Proper Sushi Consumption...
- S Style and Beauty Learn how to tie a keffiyeh on your head like a pro...
- S Style and Beauty How to Braid Hair with a Plaiting Machine: Tips and Recommendations...
- C Computers and Internet Where did torrents.ru move to?...
- H Health and Medicine How to Get Pregnant Faster?...
- A Animals and plants Money Tree Care Secrets: How to Keep Your Plant Thriving...
- S Sport How to Learn to Pull Up on Monkey Bars?...
- H Health and Medicine What was the Invention of Viagra?...
- L Leisure and Entertainment How to Properly Wind Fishing Line onto a Reel?...
- L Leisure and Entertainment How to Make a Crab Trap in Just a Few Minutes...
Answers on questions: Computers and Technology
- C Computers and Technology cani get an owa owa cani get an owa owa cani get an owa owa cani get an owa owa cani get an owa owa cani get an owa owa cani get an owa owa cani get an owa owa cani get an owa...
- C Computers and Technology Que relación existe entre la cultura organizaciónal y la cultura emprendedora...
- E English Is empress singular, plural or both...
- M Mathematics It’s been a long summer. how do you find a percent of a fraction?...
- E English In the first paragraph of chapter 9 bradford tells the story of john howland. annotate some of the language that distinguishes this account from a simple fact based retelling...
- M Mathematics Can someone me with these two questions? the last answer choice is 90 degrees....
- M Mathematics Ineed with this question. i think i need to put like an inequality or something in the blanks.. idk !...
- M Mathematics Valentina purchased 200 beads for $48 to make neckalces if she needs to buy 25 more beads how much will she pay if she is charged the same rate...
- B Biology How do properties of water affect aquatic ecosystems?...
- M Mathematics At the fair, you spend $6 for food, then use the rest of your $20 to buy ride tickets. you have enough to buy 56 tickets....
Ответ:
It was promoted by Reverend Solomon Stoddard. He felt that the people of the English colonies were drifting away from their original religious purpose by being more interested in material things.
Members, who accepted the Half-Way Covenant, agreed to follow the creed within the church and were allowed to participate in the Lord's supper. Accepting the covenant allowed the holders to have their children be baptised in the church.