Em Andamento

Students records using class

Program steps

Read the student data file partially shown below. Store this data in the classes specified.

Calculate the lab exercise totals, assignments totals, total points, percents and grade.

Display the data in the report shown.

Program Requirements

Use this class, Class, to store the student data. Note that there are only two data members and two member functions.

class Class

{

Student* students;

unsigned short numStudents;

public:

void getClassDataFromFile(const string& filename);

void report() const;

};

Create a Student class to hold the data for each student record. The Class class will need to allocate memory for an array of Student objects.

To allocate memory for the Student data array, your program must first read the file to determine how many records exist in the file.

Use the following main() for your final version of your program.

int main()

{

Class cis22b;

[url removed, login to view](Ass6DataFile);

[url removed, login to view]();

return 0;

}

Use type string to store the first name and the last name (as two separate class members). Trim the extra trailing spaces from the names.

Grade calculation is exactly the same as that specified in the course syllabus.

Round the percent (Pct in the output) to the nearest whole number.

Input Data File Example

10411807 Adams, Samuel 2 3 3 3 3 3 3 3 3 3 3 3 1 3 3 3 3 3 3 2 20 16 15 16 20 20 16 10 20 52 89

20133365 Andmary, Peter Paul 3 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 2 3 1 2 20 20 18 17 19 17 19 17 20 57 110

11188865 Beach, Sunny 3 2 2 2 2 3 3 3 3 2 2 2 2 2 2 1 2 3 1 2 20 20 18 17 19 17 19 17 16 51 110

07007007 Bond, James 2 3 3 3 3 3 2 3 2 2 2 3 1 3 3 3 3 3 0 2 20 7 20 7 20 7 20 7 20 60 70

20029123 Bright, Not Too 2 2 1 2 3 3 3 3 3 3 1 2 3 2 3 2 3 3 2 2 20 0 18 18 20 17 10 20 8 59 85

11234548 Charles, Ray 2 2 2 2 2 3 3 1 3 3 3 3 3 3 3 3 3 3 3 3 20 20 18 19 20 12 19 20 9 58 114

20095111 Dayton, Ohio 2 2 3 3 3 3 3 2 2 2 3 3 3 2 2 1 0 3 2 2 20 0 18 16 12 0 9 0 11 57 67

28881235 De La Cruz, James 0 2 2 2 2 3 3 3 2 2 2 1 2 2 2 1 2 2 2 2 20 16 15 16 19 19 19 17 20 38 86

10099850 Dylan, Bobbie 2 2 2 1 2 3 3 3 3 2 0 3 3 3 3 3 3 3 0 2 20 19 19 18 18 0 0 0 20 39 100

...

The student data file contains records with

an 8-digit student id

a student name. The name consists of a last name and first name separated by a comma (the last name is first, then the comma, then the first name). You will need to store the first and last name separately.

20 lab exercise grades

9 assignment grades. The assignment total is calculated using the same rule as the class syllabus. The lowest score, except the last one, is discarded.

a midterm grade

a final grade

All of this data must be stored in each Student object.

Program Output

The program output must look like the following.

Stud Id Name Ex Ass Mid Fin Tot Pct Gr

-------- ------------------ -- --- --- --- --- --- --

10411807 Samuel Adams 56 143 52 89 340 85 B

20133365 Peter Paul Andmary 52 150 57 110 369 92 A

11188865 Sunny Beach 44 146 51 110 351 88 B+

07007007 James Bond 49 121 60 70 300 75 C

20029123 Not Too Bright 48 131 59 85 323 81 B-

11234548 Ray Charles 53 145 58 114 370 93 A

20095111 Ohio Dayton 46 86 57 67 256 64 D

28881235 James De La Cruz 39 146 38 86 309 77 C

...

This output is only partially displayed.

Program Hint

A tricky part of this assignment is the reading and storing of the names. There are a few approaches, but to achieve the parsing, you might want to read one character at a time and store it in a char array.

Habilidades: Programação C++

Ver mais: string cplusplus, paul programming, parsing input, first lab, final trim, exercise programming, programming string functions, programming char, cplusplus string, cplusplus array, char programming, part time input data, tot, fin, calculate grade, 300 string array, version lab, input rule, void input data, programming students, data input create report, string parsing data, student record grade, string input 300, 370

Acerca do Empregador:
( 22 comentários ) Sunnyvale, United States

ID do Projeto: #5135531

Premiar a:

vano101

A proposal has not yet been provided

$18 USD em 1 dia
(137 Avaliações)
5.7

2 freelancers estão ofertando em média $19 para este trabalho

juniadsarfraz

Hi, I am Software Engineer and have excellent experience in C++ and Classes. I can do this within 2 - 3 hours. Contact me ASAP. Regards, Junaid

$20 USD in 0 dias
(6 Comentários)
2.8