Write a menu-driven C++ program to manage your college course history and plans, named as you wish. It should work something like this: Array size: 0, capacity: 2 MENU A Add a course L List all courses C Arrange by course Y arrange by Year U arrange by Units G arrange by Grade Q Quit ...your choice: a[ENTER] Enter a courses' name: Comsc-165[ENTER] Enter the year for Comsc-165 [like 2020]: 2016[ENTER] Enter the units for Comsc-165 [0, 1, 2,...]: 4[ENTER] Enter the grade for Comsc-165 [A, B,..., X if still in progress or planned]: x[ENTER] Array size: 1, capacity: 2 MENU A Add a course L List all courses C Arrange by course Y arrange by Year U arrange by Units G arrange by Grade Q Quit ...your choice: a[ENTER] Enter a courses' name: Comsc-110[ENTER] Enter the year for Comsc-110 [like 2020]: 2015[ENTER] Enter the units for Comsc-110 [0, 1, 2,...]: 4[ENTER] Enter the grade for Comsc-110 [A, B,..., X if still in progress or planned]: A[ENTER] Array size: 2, capacity: 2 MENU A Add a course L List all courses C Arrange by course Y arrange by Year U arrange by Units G arrange by Grade Q Quit ...your choice: l[ENTER] Course Year Units Grade ---------- ---- ----- ----- COMSC-165 2016 4 X COMSC-110 2015 4 A Array size: 2, capacity: 2 MENU A Add a course L List all courses C Arrange by course Y arrange by Year U arrange by Units G arrange by Grade Q Quit ...your choice: q[ENTER] Requirements Allow for course names up to 12 characters in length, like Comsc-150sql. Convert course names and grades entries to uppercase as they are inputted. Allow units to be whole numbers or floating point, per your choice. Allow grade to be a single char (like A, B, etc) or a string (like A+, B-, etc), per your choice. Use a dynamic array of objects to store the course information, with an initial capacity of 2. Double the array capacity when (a) you have a new object to add, and (b) size equals capacity. The output table should have nicely-spaced column headings. Output the array size and capacity along with the output table. Output blank lines to separate blocks of text as modeled in the sample output above. Serialize using a binary file named courses.dat.
Write a menu-driven C++ program to manage your college course history and plans, named as you wish. It should work something like this:
Array size: 0, capacity: 2
MENU
A Add a course
L List all courses
C Arrange by course
Y arrange by Year
U arrange by Units
G arrange by Grade
Q Quit
...your choice: a[ENTER]
Enter a courses' name: Comsc-165[ENTER]
Enter the year for Comsc-165 [like 2020]: 2016[ENTER]
Enter the units for Comsc-165 [0, 1, 2,...]: 4[ENTER]
Enter the grade for Comsc-165 [A, B,..., X if still in progress or planned]: x[ENTER]
Array size: 1, capacity: 2
MENU
A Add a course
L List all courses
C Arrange by course
Y arrange by Year
U arrange by Units
G arrange by Grade
Q Quit
...your choice: a[ENTER]
Enter a courses' name: Comsc-110[ENTER]
Enter the year for Comsc-110 [like 2020]: 2015[ENTER]
Enter the units for Comsc-110 [0, 1, 2,...]: 4[ENTER]
Enter the grade for Comsc-110 [A, B,..., X if still in progress or planned]: A[ENTER]
Array size: 2, capacity: 2
MENU
A Add a course
L List all courses
C Arrange by course
Y arrange by Year
U arrange by Units
G arrange by Grade
Q Quit
...your choice: l[ENTER]
Course Year Units Grade
---------- ---- ----- -----
COMSC-165 2016 4 X
COMSC-110 2015 4 A
Array size: 2, capacity: 2
MENU
A Add a course
L List all courses
C Arrange by course
Y arrange by Year
U arrange by Units
G arrange by Grade
Q Quit
...your choice: q[ENTER]
Requirements
- Allow for course names up to 12 characters in length, like Comsc-150sql.
- Convert course names and grades entries to uppercase as they are inputted.
- Allow units to be whole numbers or floating point, per your choice.
- Allow grade to be a single char (like A, B, etc) or a string (like A+, B-, etc), per your choice.
- Use a dynamic array of objects to store the course information, with an initial capacity of 2.
- Double the array capacity when (a) you have a new object to add, and (b) size equals capacity.
- The output table should have nicely-spaced column headings.
- Output the array size and capacity along with the output table.
- Output blank lines to separate blocks of text as modeled in the sample output above.
- Serialize using a binary file named courses.dat.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps