Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming and Data Structures University roster using linked lists Create a C++ program to manage the list of enrolled students in a university. The data

Programming and Data Structures

University roster using linked lists

Create a C++ program to manage the list of enrolled students in a university. The data of each student will be stored as nodes of an ordered linked list. You should be able to add and delete students from the list, and perform other operation on the stored data.

Student information include:

ID number (integer of 5 digits)

First name

Last name

Major

GPA (double, between 0 and 4)

Current Credit Enrolled (integer, between 0 and 15)

Input and Output

The input is a single text file. Each file is divided in blocks that call different operations on the linked list, followed by the necessary arguments. The name used to declare the instruction to execute will be all in upper cases. Each new argument is in a new line of the file. Your program should go through the file and execute all the listed operations, and terminate when the end of file is reached. It is fair to assume that all calls will be in upper case letters and will always be separated by an empty line, even when the number of arguments is incorrect for the function call. The file terminates with new line and EOF.

Example 1 of input

INSERT

03948

Tom

Brady

Physics

3.40

12

INSERT

03491

Joe

Flacco

Chemistry

3.91

12

PRINT_ROSTER

PRINT_STUDENT

Joe

Flacco

The output of each function call should be appended to an output file (name specified in the command line). Example 1 of output

Tom Brady, 03948

Joe Flacco, 03491

Joe Flacco, 03491

Major: Chemistry

GPA: 3.91

Credits enrolled: 12

Complete list of instruction calls for ordered linked list

image text in transcribedimage text in transcribed

The result should be written on another text file (output file), provided on the command line. The input and output files are specified in the command line, not inside the C++ code.

The general call to the executable (sum_rowcol, in this example) is as follows: uni_roster "A=;C="

Call example with one input file and another output file. uni_roster "A=a.txt;C=c.out"

It is NOT allowed to use vector classes or other classes provided in the STL.

Call INSERT Output Description Insert a new student ID numbeir in the linked list First Name ORDERED BY LASTLast Name NA Arguments ME. Duplicates Major should be rejected (by GPA ID or first +last name Current Credits Print first name, last - name and ID of all students PRINT ROSTER , PRINT_BY_MAJOR Print first name, last Major , name and ID of all students in a major Print first name, lastGPA name and ID of all students with GPA greater or equal to argument PRINT_BY GPA , PRINT_STUDENTPrint all data of First Name Last Name , Major: GPA: Credits Enrolled: student Call INSERT Output Description Insert a new student ID numbeir in the linked list First Name ORDERED BY LASTLast Name NA Arguments ME. Duplicates Major should be rejected (by GPA ID or first +last name Current Credits Print first name, last - name and ID of all students PRINT ROSTER , PRINT_BY_MAJOR Print first name, last Major , name and ID of all students in a major Print first name, lastGPA name and ID of all students with GPA greater or equal to argument PRINT_BY GPA , PRINT_STUDENTPrint all data of First Name Last Name , Major: GPA: Credits Enrolled: student

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Marketing Database Analytics

Authors: Andrew D. Banasiewicz

1st Edition

0415657881, 978-0415657884

More Books

Students also viewed these Databases questions