Write a C++ program to prompt user for a file name and read the data containing information for a course, store and process the data, display a menu and allow user to pick an operation to perform continue till user decides to quit, and at the end print a final report
Write a C++ program to prompt user for a file name and read the data containing information for a course, store and process the data, display a menu and allow user to pick an operation to perform continue till user decides to quit, and at the end print a final report
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Write a C++ program to prompt user for a file name and read the data containing information for a course, store and process the data, display a menu and allow user to pick an operation to perform continue till user decides to quit, and at the end print a final report shown below.
Details:
- Set the array size to 50, but there could be less or more students info in the file, manage the list according the actual data elements.
- Develop a struct named Student to represent a student’s data: (Minimum the following data members need to be included), more is OK.
- Name (First, Last)
- ID
- Scores (An array to store test scores)
- Quiz (score for 1 quiz)
- Grade
- Average
- Write all the necessary utility functions to process the Student struct (readStudent, printStudent, processStudent,…)
- You may update and use the struct definition and utility functions developed for
Programming assignment 5 or develop a new one.
- You may update and use the struct definition and utility functions developed for
- Develop any additional functions to process a list of students as necessary (Such as readStudentList, printStudentList, processStudentList, ….).
- Required Operations are: (use functions to do these)
- Print course content to the monitor and a file (refer to sample output below)
- Sort the list of students and print it to the monitor:
- Alphabetical (Based on last name)
- Search the list of students and print all the details of a student to the monitor (prompt user for the last name of the student, assume all last names are unique)
- Add a new student to the list (Prompt user for data for the new student, don’t add duplicates, check last name to make sure they are not on the list already, if the student is already on the list print an error message and continue with the program))
- Delete a student from the list (prompt user for the last name of the student, if student is not on the list print an error message and continue with the program)
- main function will:
- declare an array of Students to store and manage students' data
- call the function readList to open file and read the data and store them in the array of students. If the file did not open or is blank print an error message and stop the program. Refer to the exact messages provided in the test cases.
- call function procesList to process the list of students by
- calling function calcAverage
- calling function assignGrade
- call function printToFile to print a complete report to a file (Refer to the sample below)
- call function searchStudent to prompt user for a student's last name, if on the list print details, otherwise print error message (Refer to the sample below)
- call function addStudent to add a new student to the list
- call function removeStudent to remove a student from the list
- call function printToMonitor to print the student's info. (Refer to the sample below)
- call function sortList to sort the list alphabetically
- call function printToMonitor to print the student's info. (Refer to the sample below)
Requirements:
- Program must be modular (all tasks must be done in functions)
- Must include functions to process object or list of objects (Auxiliary/Helper functions)
- Main should be short and mostly made of call to functions. (no loops)
- Prompt user for all input and output file names
- At start of program execution, prompt user for an input file name, start the program with loading the data into the program and then do all the operations one by one pause the program and let the user continue.
- Global variables are not allowed. All variables must be passed to functions.
- Your program should calculate the average for the student and assign a letter grade using the provided scale table.
- To calculate the average, use the highest 5 test scores and the quiz score. (Drop the lowest test score).
- Tests are worth 90% of the total and the quiz is 10%.
- Verify that all scores are between 0..100, if not set average to -1 and grade to I.
- Use the following grading scale:
- If the average is from 90 to 100 the grade is A
- If the average is from 80 to 89.9 the grade is B
- If the average is from 70 to 79.9 the grade is C
- If the average is from 60 to 69.9 the grade is D
- If the average is from 0 to 59.9 the grade is F
- If any score is invalid grade is I
- Use attached data files to test your program. They are included in this folder on zyBooks.
Input data file organization:
Course_Name Course_Id Location List of students First Last (first is always 1 name but last name could have several part separated by space) ID Quiz Test1 … Test6 (Assume each student has 6 test scores)
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education