Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

Assignment: Programming and Data Structures

Introduction

In this homework, you will 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

Call

Description

Arguments

Output

INSERT

Insert a new student in the linked list ORDERED BY LAST NAME.Duplicates should be rejected (by ID or first + last name)

ID_number First Name Last Name Major GPA Current Credits

-

PRINT_ROSTER

Print first name, last name and ID of all

students

-

,

...

PRINT_BY_MAJOR

Print first name, last name and ID of all

students in a major

Major

,

...

PRINT_BY_GPA

Print first name, last name and ID of all students with GPA greater or equal to

argument

GPA

,

...

PRINT_STUDENT

Print student all data of

First Name Last Name

, Major:

GPA:

Credits Enrolled:

DELETE_STUDENT

Delete student from

list based on first and last name

First Name Last Name

-

DELETE_ID

Delete student from list     based on ID number

ID number

-

UPDATE_GPA

Set GPA of student to new value

First Name

Last Name GPA

-

UPDATE_MAJOR

Change student major to new value

First Name

Last Name Major

-

ADD_CLASS

Add class for student (reflects    on    credits

enrolled)

First Name Last Name

credits

-

REMOVE_CLASS

Remove      class                 for student                 (reflects    on

credits enrolled)

First Name Last Name

credits

-

GPA

Compute average GPA across students

-

GPA mean:

The main C++ program will become the executable to be tested by the TAs. 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"

Requirements

• Your ordered linked list must inherit from the linkedListType ADT presented in class and available in the book (pg. 278-292).

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

• Your C++ code must be clear, indented and commented.

• Each function call should check for input correctness. If the input is of invalid format, do not perform the operation and print an error on screen. Examples of input correctness include right number and type of arguments, or checking for argument boundaries (for GPA, credits and ID).

• GPA must be printed with 2 decimal points.

• Your program will be tested with GNU C++. Therefore, you are encouraged to work on Unix, or at least make sure that your code compiles and runs successfully on the server.

• You can use other C++ compilers, but the TAs cannot provide support or test your programs with other compilers.

• The output file must contain the result in the format specified in the table. A single empty line should separate each output segment.

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M92475978

Have any Question?


Related Questions in C/C++

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As