c++ programming

Anonymous
timer Asked: Nov 9th, 2013
account_balance_wallet $5

Question Description

c++

Write a program that uses two structures to store the following data:

Student

Ø  id    // student id

Ø  name  // student name

Ø  tests   // a pointer to an array of test scores

Ø  avg    // average test score

Ø  grade  // course grade

Course

Ø  crn    // course registration number, such as 21719

Ø  cid   // course id, such as CIS-022B-01

Ø  noStu  // number of students in the class

Ø  noTests  // number of tests

Ø  stuList  // a pointer to an array of Student structures

The program keeps a list of test scores for a group of students. It reads data from cis22B.txt. It dynamically allocates a course structure and reads the corresponding data from the text file into the structure (crn, cid, noStu, noTests). Then it uses noStu to dynamically allocate an array of Student structures (stuList). Each structure’s tests member should point to a dynamically allocated array that will hold the test scores (noTests)

After the array has been created and loaded, the program calculates the average test score and determines the grade for each student (A: 91-100 , B: 81-90, C: 71-80, D: 61-70, F: 60 or below).

Sort the array in ascending order by student name.

Write to sorted.txt the following: crn, cid, noStu, and a table (header included) containing the student id, the name of the student, the average score and the grade.


This question has not been answered.

Create a free account to get help with this and any other question!

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