Simple Java question with comments needed

Dec 14th, 2014
Computer Science
Price: $25 USD

Question description


Write a program in Java and run it in BlueJ according to the following specifications:

  • The program reads a text file with student records (first name, last name and grade) and prints them in the terminal window.
  • After the name and grade it also prints the type of the grade: excellent (> 89), ok [60,89], and failure (< 60).
  • Then the program prints the number of students, and their average grade and also the number of students and their average in each grade category (excellent, ok, and failure).

For example, with the input file students.txt the program must print the following:

John Smith  90 excellent
Barack Obama  95 excellent
Al Clark  80 ok
Sue Taylor  55 failure
Ann Miller  75 ok
George Bush  58 failure
John Miller  65 ok

There are 7 students with average grade 74.0
There are 2 excellent students with average grade 92.5
There are 3 ok students with average grade 73.3333
There are 2 failre students with average grade 56.5

Requirements and restrictions

  • Use the and classes from the course website to represent and process student records and modify them accordingly:
    • The encapsulation principle must be strictly enforced.
    • The main method in class Students should only read the text file, and print student records (student names, grade and grade type) and statistics (number of students and averages).No other kinds of computations should be included in the main method (e.g. checking student grade intervals and student type, counting students, totaling grades).
    • All counting, totaling, computing averagas, checking grade intervals, and assigning grade types to students should be implemented in class Student. Hints: use static variables in class Student and add methods to compute and return (or print) averages. Modify the toString() method to return the grade type too.
  • When you write your program
    • use proper names for the variables suggesting their purpose.
    • format your code accordingly using indentation and spacing.
    • use multiple line comment in the beginning of the code and write your name, e-mail address, class, and section.
    • for each line of code add a short comment to explain its meaning.

Tutor Answer

(Top Tutor) Daniel C.
School: Cornell University

Studypool has helped 1,244,100 students

Review from our student for this Answer

Dec 16th, 2014
"Totally impressed with results!! :-)"
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1827 tutors are online

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors