Objectives: Solve problem, design solution and implement using C++…
Question Answered step-by-step Objectives: Solve problem, design solution and implement using C++… Objectives:Solve problem, design solution and implement using C++Learn how to use basic C++ constructs and manipulate C++ string classHandle different types of input errorsDescription:Make a c++ menu-driven program named “enrollClasses that will read in the student name and idthen provides the following menu:1. enroll2. summarize3. detail4. exit- “enroll” option will read in the class name and the number of units- “summarize” option will print out the brief student enrollment info: name, id, total number of classes, total number of units and the total fee based on $31.00 per unit.- “detail” option will print out all the info in the “summarize” option and the actual list of classesRequirements:1. The program must produce the same expected output as provided.2. Array or vector or list is not allowed. This is an assignment using string, stream, functions. Simple variables and string concatenation will be sufficient to solve this problem.3. There should be no global variables. Please use only local variables and parameters instead4. You must define and use at least 6 functions including main() in your program5. Scanf and printf are not allowed (Please use C++ cin and cout and C++ formatting)6. Please format fee with only 2 decimal places after the period. The list of classes need to be aligned.7. Please handle the following input errors:- student name cannot be empty or has only blanks- student id cannot be 0 or negative or non-numericSample output of a program run:E:>enrollClassesPlease enter the student’s name:Student name cannot be empty or has only blanks.Please enter the student’s name:Student name cannot be empty or has only blanks.Please enter the student’s name: Hoang NguyenPlease enter the student’s id: -1Invalid student id. Please try again.ID: -1Please enter the student’s id: 0Invalid student id. Please try again.ID: 0Please enter the student’s id: abcInvalid student id. Please try again.ID: 0Please enter the student’s id: 123456Enrollment menu:1. enroll2. summarize3. detail4. exitOption: 2======================================Name: John SmithID: 123456Total classes: 0Total units: 0Total fee: $0.00======================================Enrollment menu:1. enroll2. summarize3. detail4. exitOption: 3======================================Name: John SmithID: 123456Total classes: 0Total units: 0Total fee: $0.00======================================Enrollment menu:1. enroll2. summarize3. detail4. exitOption: 1Please enter the class name: CIS 2BPlease enter the number of units for this class: 4Enrollment menu:1. enroll2. summarize3. detail4. exitOption: 2======================================Name: John SmithID: 123456Total classes: 1Total units: 4Total fee: $124.00======================================Enrollment menu:1. enroll2. summarize3. detail4. exitOption: 3======================================Name: John SmithID: 123456Class: CIS 2B Units: 4Total classes: 1Total units: 4Total fee: $124.00======================================Enrollment menu:1. enroll2. summarize3. detail4. exitOption: 1Please enter the class name: CIS2C Please enter the number of units for this class: 5Enrollment menu:1. enroll2. summarize3. detail4. exitOption: 2======================================Name: John SmithID: 123456Total classes: 2Total units: 9Total fee: $279.00======================================Enrollment menu:1. enroll2. summarize3. detail4. exitOption: 3======================================Name: John SmithID: 123456Class: CIS 2B Units: 4Class: CIS2C Units: 5Total classes: 2Total units: 9Total fee: $279.00======================================Enrollment menu:1. enroll2. summarize3. detail4. exitOption: 1Please enter the class name: CIS3Please enter the number of units for this class: 3Enrollment menu:1. enroll2. summarize3. detail4. exitOption: 2======================================Name: John Smith ID: 123456Total classes: 3Total units: 12Total fee: $372.00======================================Enrollment menu:1. enroll2. summarize3. detail4. exitOption: 3======================================Name: John SmithID: 123456Class: CIS2B Units: 4Class: CIS2C Units: 5Class: CIS3 Units: 3Total classes: 3Total units: 12Total fee: $372.00======================================Enrollment menu:1. enroll2. summarize3. detail4. exitOption: 5Invalid option. Please try again.Enrollment menu:1. enroll2. summarize3. detail4. exitOption: 4Thank you. Computer Science Engineering & Technology C++ Programming CIS 22b Share QuestionEmailCopy link Comments (0)


