Question
HI, This is a c++ program. I posted this question before but, I could not find the answer in brief. I am a beginner. I
HI, This is a c++ program. I posted this question before but, I could not find the answer in brief. I am a beginner. I will appreciate the help thank you.
Write a menu-driven C++ program to track your favorite movies.
It should work something like this:
MENU U Update a movie E rEmove a movie L List all movies T arrange by Title V arrange by year Viewed R arrange by Rating Q Quit ...your choice: l[ENTER] # Title Viewed Rating -- --------------------------- ------ ------ 1 movie1 0 0 2 movie2 0 0 3 movie3 0 0 MENU U Update a movie E rEmove a movie L List all movies T arrange by Title V arrange by year Viewed R arrange by Rating Q Quit ...your choice: u[ENTER] Which movie to update [1-3]: 1[ENTER] Enter an updated name for movie1: Star Wars[ENTER] Enter the year you saw Star Wars [like 2016]: 1977[ENTER] Enter your rating for Star Wars [1, 2, 3, 4, 5]: 5[ENTER] MENU U Update a movie E rEmove a movie L List all movies T arrange by Title V arrange by year Viewed R arrange by Rating Q Quit ...your choice: u[ENTER] Which movie to update [1-3]: 2[ENTER] Enter an updated name for movie2: Mission Impossible[ENTER] Enter the year you saw Mission Impossible [like 2016]: 2015[ENTER] Enter your rating for Mission Impossible [1, 2, 3, 4, 5]: A[ENTER] MENU U Update a movie E rEmove a movie L List all movies T arrange by Title V arrange by year Viewed R arrange by Rating Q Quit ...your choice: l[ENTER] # Title Viewed Rating -- --------------------------- ------ ------ 1 Star Wars 2016 1 2 Mission Impossible 2015 2 3 movie3 0 0 MENU U Update a movie E rEmove a movie L List all movies T arrange by Title V arrange by year Viewed R arrange by Rating Q Quit ...your choice: e[ENTER] Which movie to remove [1-3]: 2[ENTER] # Title Viewed Rating -- --------------------------- ------ ------ 1 Star Wars 2016 1 2 movie3 0 0 MENU U Update a movie E rEmove a movie L List all movies T arrange by Title V arrange by year Viewed R arrange by Rating Q Quit ...your choice: q[ENTER]
You may use C strings or C++ string in this -- your choice.
Requirements
Allow for movie titles up to 30 characters in length.
Do case-independent sorting, but do not convert the case of movie titles when they are entered using cin.
You decide upon your rating system -- can be any data type.
Use a linked list to store the movie information, initially empty, but with three nodes added before the main loop starts.
The output table should have nicely-spaced column headings with sequence numbers.
Use sequence numbers for the update and remove options.
If an out-of-range sequence number is entered for either the remove or update options, either ignore it or output a warning -- your choice.
Output blank lines to separate blocks of text as modeled in the sample output above.
Limitations
Unfortunately, we cannot add nodes, because nodes have to have been already declared in order to be in the linked list.
So do this -- start with 3 or more nodes, initialized to generic movie titles (like movie1). Put them all in the list before starting the menu loop. Once a node is removed, it's gone!
Keeping Track Of The Number Of Nodes
Did you notice the "Which movie to update [1-3]:" prompt? It's not as easy as it looks! What if a node has been removed? Then it's "[1-2]". You'll need a way to keep track of the number of nodes in your list, and a way to put that number in the update and remove prompts. It's not too hard if you think about it and plan it out.
Do not save the sequence number as an attribute of the movie objects!
Submit your CPP and screenshots of outputs for grading.
Rubric
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started