Need programming help with a file that contains students’ ID

Dec 25th, 2015
SKTFaker
Category:
Programming
Price: $5 USD

Question description

You are given a file called “students.txt” that contains students’ ID and marks as follows:

200121101 9 19 29 29

200121102 5 10 14 30

200121103 6 15 20 20

200121104 10 17 25 35

200121105 10 18 26 37

200121106 8 14 23 32

200121107 10 20 30 40

200121108 10 19 25 30

200121109 6 8 6 17

200121110 5 15 20 30

200121111 9 9 20 29

200121112 10 10 29 9

Each line consists of a student’s ID, first_mark, midterm_mark, lab_mark and final_mark. The number of students is not specified in advance.

Write a program that calls the following methods:

  1. ReadData that reads data from “students.txt”. It should take as parameters an array of String studentID and a two-dimensional array of int marks. It stores the students’ ID in the array studentID and the students’ marks in the array marks. This method returns the number of students found in the file.
  2. CalculateTotalMarks that takes as parameters the two-dimensional array of int marks, an array of int total and the number of students. It should calculate the total mark for each student and store it in total.
  3. FindGrades that takes as parameters the array of int total, an array of char grades and the number of students. It should find the appropriate character grade for each student and store it in grades.
  4. calculateAverage that takes as parameters the array of int total and the number of students. It should calculate and return the average class mark.
  5. FindMax that takes as parameters the array of int total and the number of students. It should find and return the class highest mark.
  6. FindMin that takes as parameters the array of int total and the number of students. It should find and return the class lowest mark.
  7. PrintResults that takes as parameters the array of String studentID, the array of int total, the array of char grades, and the number of students. It should output in the file ‘Results.txt” the following data:

a)  The Student’s ID, total mark, and grade for all students who passed the course.

b)  The Student’s ID, total mark, and grade for all students who failed the course.

c)  The total number of students.

d)  The average class mark.

e)  The highest mark.

f)  The lowest mark.

Sample output data are shown below:

Students who passed are:

200121101  86  B

200121103  61  D

200121104  87  B

200121105  91  A

200121106  77  C

200121107  100  A

200121108  84  B

200121110  70  C

200121111  67  D

Students who failed are:

200121102  59  F

200121109  37  F

200121112  58  F

The total number of students:  12

The average total mark:  73.08333333333333

The highest mark:  100

The lowest mark:  37


Tutor Answer

(Top Tutor) Daniel C.
(997)
School: Rice University
PREMIUM TUTOR

Studypool has helped 1,244,100 students

7 Reviews


Summary
Quality
Communication
On Time
Value
kpcutie
Dec 6th, 2016
" Excellent job "
Hemapathy
Nov 22nd, 2016
" all I can say is wow very fast work, great work thanks "
BlueOcean
Nov 9th, 2016
" Awesome! Exactly what I wanted. "
kevin12622
Oct 31st, 2016
" Goes above and beyond expectations ! "
ashleyisgod
Oct 17th, 2016
" Top quality work from this guy! I'll be back! "
likeplum4
Oct 8th, 2016
" Excellent work as usual "
Molly_Moon
Sep 25th, 2016
" AMAZING as always! "
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1830 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