Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Construct a menu-driven C++ program to trackyour favorite movies using a linked list stack . Name the CPP as you wish. It should work something

Construct a menu-driven C++ program to trackyour favorite movies using a linked liststack. Name the CPP as you wish. It should work something like this:

MENU A Add a movie U Update a movie E Erase a movie L List all movies T arrange by Title V arrange by year Viewed R arrange by Rating Q Quit ...your choice: a[ENTER] Enter a movie's name: 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]: 1[ENTER] MENU A Add a movie U Update a movie E Erase a movie L List all movies T arrange by Title V arrange by year Viewed R arrange by Rating Q Quit ...your choice: a[ENTER] Enter a movies' name: 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]: 2[ENTER] MENU A Add a movie U Update a movie E Erase 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 Mission Impossible 2015 2 2 Star Wars 2016 1 MENU A Add a movie U Update a movie E Erase 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] 

Requirements

  1. You decide whether to useC or C++ strings,as long asmovie titlescan beup to 50characterslong.
  2. Use dynamic memory to allocate nodes for the linked list.
  3. The rating system should be between integer 1 to 5.
  4. The "remove" option should actuallyremovethe node. Usesequence numberingto identify the movie to remove, with the valid range of numbers in the prompt.
  5. You decide what to say, if anything, if there'sno matchforanyof theuser's input.
  6. Use alinked listto store the movie information, initially empty.
  7. Add new nodes at thefrontof the list.
  8. The output table should have nicely-spacedcolumn headingsand sequence numbering.
  9. Useblank linesin the output to separate blocks of text as modeled in the sample output above.
  10. Apply serialization to a TXT file namedmovies.txtbefore terminating the program. There is no need to serialize up at the beginning of the program.
  11. Print the updated list when an arrangement is made.
  12. Avoid memory leaks as nodes are removed and when the program ends -- use adeleteloop.

Usesequence numbersfor the "remove" and "update"options, like this:

 # Title Viewed Rating -- --------------------------- ------ ------ 1 Mission Impossible 2015 2 2 Star Wars 2016 1 MENU A Add a movie U Update a movie E Erase 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-2)? 2[ENTER] 

That is,show the full range of valid sequence number choices, exactly as in the previous lab assignment. This is to show that you can eitherkeep track of, orcount, the number of nodes in a linked list.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

13. Given: following definite integral: cos xdx. 1/6

Answered: 1 week ago