Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Program reads info about students and their scores from a file and output the name of each student w/all his/her scores and the total score, plus the average score of the class, and the name and total score of the students with the highest and lowest total score.
4 files are provided:
SavitchIn.java - contains simple input library
FileIOHelper.class - contains a class for simple file input
Sutdent.class - class for student records
info.txt - sample input file
Program performs following actions: 1.Ask the user to enter the name of a file containing information about student scores and input the file name 2.Input the student info from the file and store it in an appropriate array of Student objects 3.Output in a well formatted table the name, individual scores, and total score for each student 4.Output the number of students in the class, the average total score, and the maximum and minimum total score in the class
The input file will contain info about student scores in the following format:





. . .
The first line must contain the number of students in the input file, is a string representing a student name, and , , are integers representing the 3 student scores. Solution must work with an input file following this format but with an arbitrary number of student records.

Sample interaction b/t a user and the program:

Enter file name: info.txt

Name Score1 Score2 Score3 Total
------------------------------------------
Andy Smith 200 250 400 850
Jake Wise 120 220 330 670
------------------------------------------
The total number of students in this class is: 2
The average total score of the class is: 760
Andy Smith got the maximum total score of: 850
Jake Wise got the minimum total score of: 670
-------------------------------------------

The FileIOHelper class provides 2 class methods:

1.int FileIOHelper.getNumberofStudents(String fileName): takes a String parameter which is the name of an input file in the format described above, and returns the number of students in the file

2.Student FileIOHelper.getNextStudent(): takes no parameters, inputs the name and scores for the next student in the input file, and returns a Student object w/the corresponding value.

A Student object has a name (String) and 3 scores (integers). The Student class provides the following (instance) methods to manipulate Student objects:

1.Student(String name), a constructor: takes a String parameter, the name, and creates a Student object w/the given name and 0 for all the scores

2.String std.getName(): returns the name of student std

3.int std.getScore1(): returns the first score for student std

4.int std.getScore2(): returns the second score for student std [continued for 3rd score]

5.void std.setScore1(int score): takes an integer score, and sets the first score for student std

6.void std.setScore2(int score): takes and integer score and sets the 2nd score for student.std [continues for 3rd]

Attachment:- Desktop.zip

Java, Programming

  • Category:- Java
  • Reference No.:- M91613045
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Java

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Project requirementsfor the problem described in the next

Project requirements For the problem described in the next section, you must do the following: 1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section ...

In ruby the hash class inherits from enumerable suggesting

In Ruby, the Hash class inherits from Enumerable, suggesting to a programmer that Hashes are collections. In Java, however, the Map classes are not part of the JCF (Java Collections Framework). For each language, provide ...

Object-oriented software development1 introduction 11

OBJECT-ORIENTED SOFTWARE DEVELOPMENT 1. Introduction 1.1 Assignment Requirement 1.2 Deliverables and Structure (what to submit) 1.3 Software Restrictions 1.4 How to score high... 1.5 Assumptions 2. System Requirements 2. ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

Solving 2nd degree equationsbull write the following java

Solving 2nd degree equations • Write the following Java methods • boolean real-sols(double a, double b, double c): it returns true if the 2nd degree equation ax2 + bx + c has real solutions • double solution1(double a, d ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As