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
icon
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.
  • 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)

Error messages
Bad file name: Failed to open file.
File with no data: Empty file.
Adding student Error Adams is on the list, duplicated names are not allowed. (Adams is the student we are trying to add)
Removing student and search Error Adams is on the list. (Adams is the student we are trying to remove or find)
If your process is different, then the test case will fail, make sure to follow the same call order in the main
Transcribed Image Text:Error messages Bad file name: Failed to open file. File with no data: Empty file. Adding student Error Adams is on the list, duplicated names are not allowed. (Adams is the student we are trying to add) Removing student and search Error Adams is on the list. (Adams is the student we are trying to remove or find) If your process is different, then the test case will fail, make sure to follow the same call order in the main
Sample input file: (Assume all names and IDs in the list are unique and must stay unique.)
Introduction to Computer Programming Fundamentals
CSCI 1
MBA 315
John Adams
111223333 100 87 93 90 90 89 91
Willy Smith Jr.
222114444 90 73 67 77 70 80 90
Phil Jordan
777886666 100 80 70 50 -60 90 100
Sample output file format: (Final report)
Course Name:
Course ID:
Class Location:
Name
Adams, John
Smith Jr., Willy
Jordan, Phil
Name
Adams, John
Smith Jr., Will
Jordan, Phil
Introduction to Computer Programming Fundamentals
CSCI 1
MBA 315
ID
Student list print format to the monitor:
111-22-3333
222-11-4444
777-88-6666
Average:
Letter Grade: A
Average
91.5
87.0
-1
Student's detail format to the monitor:
Name:
Adams, John
ID:
111223333
Quiz Score:
100.00
Test Scores: 87.00
91.54
93.00
Grade
A
B
I
Average
91.5
87.0
-1
90.00
Grade
A
B
I
90.00
89.00
91.00
Transcribed Image Text:Sample input file: (Assume all names and IDs in the list are unique and must stay unique.) Introduction to Computer Programming Fundamentals CSCI 1 MBA 315 John Adams 111223333 100 87 93 90 90 89 91 Willy Smith Jr. 222114444 90 73 67 77 70 80 90 Phil Jordan 777886666 100 80 70 50 -60 90 100 Sample output file format: (Final report) Course Name: Course ID: Class Location: Name Adams, John Smith Jr., Willy Jordan, Phil Name Adams, John Smith Jr., Will Jordan, Phil Introduction to Computer Programming Fundamentals CSCI 1 MBA 315 ID Student list print format to the monitor: 111-22-3333 222-11-4444 777-88-6666 Average: Letter Grade: A Average 91.5 87.0 -1 Student's detail format to the monitor: Name: Adams, John ID: 111223333 Quiz Score: 100.00 Test Scores: 87.00 91.54 93.00 Grade A B I Average 91.5 87.0 -1 90.00 Grade A B I 90.00 89.00 91.00
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Array
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education