You will then create a separate class, Assignment8A. In its main method, you should do the following: • Ask the user how many movies are in their collection Create an array (of type LaserDisc) of that size Use a loop to ask the user to enter information for all movie • Create a LaserDisc object for each movie and store it in the next index in the array Then using another loop, you should give the user the following options: Print movie information • This should ask the user for a number, and then print the information from the LaserDisc object at that index. If the index is out of bounds, it should notify the user instead. • Recommend a good movie from the collection • This should choose a random movie, check if it is a good movie based on the relevant function, and either print the information to the user or guess again if it was not a good movies If there are no good movies in the collection, tell the user that no good movies exist in the collection. Hint: You can use a counter variable to keep track of the guesses. When you've guessed more times than numbers of elements in the array, you can stop. However, this means you might miss some movies if the same index is randomly selected multiple times. If you want to challenge yourself further, consider another way you could handle that situation. Quit • Ends the loop and the program Sample Output: [Laser Disc Collection] How many movies do you'have? 10 Movie 1: *Enter Title: Back to the Future *Enter Genre: Science Fiction *Enter Release Year: 1985 *Enter Rating: 5.0 Movie 2: *Enter Title: Twin Peaks Season 1 *Enter Genre: Mystery-Horror Serial Drama *Enter Release Year: 1992 "Enter Rating: 4.5 //Keep going for all 10 movies (THIS IS NOT PART OF THE OUTPUT) [Main Menu] 1) Movie Info 2) Recommend a Good Movie 3) Log off

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Code written in C++ ONLY!!!!

**Assignment8A Class Explanation**

This program is designed to manage a movie collection using a class called `Assignment8A`. Here’s an overview of its functionality:

### Main Method Tasks:
- **User Input for Collection Size**: Prompt the user to input the number of movies they want to store.
- **Array Creation**: Create an array of `LaserDisc` objects to hold the movies.
- **Data Entry Loop**: Use a loop to gather details for each movie, prompting the user to enter:
  - Title
  - Genre
  - Release Year
  - Rating
- **Store Movie Data**: Create a `LaserDisc` object for each movie and store it in the next available index in the array.

### Interactive Loop for User Options:
- **Main Menu Options**:
  1. **Print Movie Information**:
     - Prompt the user for a movie index.
     - Display the movie details if the index is valid; otherwise, notify the user.
     
  2. **Recommend a Good Movie**:
     - Randomly select a movie and check if it is "good" using a specified function.
     - Display the movie information if it qualifies as "good."
     - If no good movies exist, notify the user.
     - Hint: Use a counter to limit guesses to prevent infinite loops.
     
  3. **Quit**:
     - End the program.

### Sample Output:
The program includes example dialogues for interaction:
1. **Movie Collection Size Prompt**:
   - Asks: "How many movies do you have?"
   - Example: Enter 10

2. **Movie Data Input**:
   - Movie 1: "Back to the Future"
     - Genre: Science Fiction
     - Release Year: 1985
     - Rating: 5.0
   - Movie 2: "Twin Peaks Season 1"
     - Genre: Mystery-Horror Serial Drama
     - Release Year: 1992
     - Rating: 4.5
   - Continue until all movies are entered.

3. **Main Menu Display**:
   - Options:
     1. Movie Info
     2. Recommend a Good Movie
     3. Log Off

This structured approach helps users manage their movie collection efficiently by leveraging loops, arrays, and user inputs to store and recommend movies.
Transcribed Image Text:**Assignment8A Class Explanation** This program is designed to manage a movie collection using a class called `Assignment8A`. Here’s an overview of its functionality: ### Main Method Tasks: - **User Input for Collection Size**: Prompt the user to input the number of movies they want to store. - **Array Creation**: Create an array of `LaserDisc` objects to hold the movies. - **Data Entry Loop**: Use a loop to gather details for each movie, prompting the user to enter: - Title - Genre - Release Year - Rating - **Store Movie Data**: Create a `LaserDisc` object for each movie and store it in the next available index in the array. ### Interactive Loop for User Options: - **Main Menu Options**: 1. **Print Movie Information**: - Prompt the user for a movie index. - Display the movie details if the index is valid; otherwise, notify the user. 2. **Recommend a Good Movie**: - Randomly select a movie and check if it is "good" using a specified function. - Display the movie information if it qualifies as "good." - If no good movies exist, notify the user. - Hint: Use a counter to limit guesses to prevent infinite loops. 3. **Quit**: - End the program. ### Sample Output: The program includes example dialogues for interaction: 1. **Movie Collection Size Prompt**: - Asks: "How many movies do you have?" - Example: Enter 10 2. **Movie Data Input**: - Movie 1: "Back to the Future" - Genre: Science Fiction - Release Year: 1985 - Rating: 5.0 - Movie 2: "Twin Peaks Season 1" - Genre: Mystery-Horror Serial Drama - Release Year: 1992 - Rating: 4.5 - Continue until all movies are entered. 3. **Main Menu Display**: - Options: 1. Movie Info 2. Recommend a Good Movie 3. Log Off This structured approach helps users manage their movie collection efficiently by leveraging loops, arrays, and user inputs to store and recommend movies.
### Text Transcription for Educational Use

---

**[Main Menu]**
1) Movie Info  
2) Recommend a Good Movie  
3) Log off  

**Choice:** 1

**Which movie do you want?** 100  
Sorry, that’s not a valid Movie index

---

**[Main Menu]**
1) Movie Info  
2) Recommend a Good Movie  
3) Log off  

**Choice:** 1

**Which movie do you want?** 0  
0. Back to the Future, 1985  
   - **Genre:** Science-Fiction  
   - **Rating:** 5.0  

---

**[Main Menu]**
1) Movie Info  
2) Recommend a Good Movie  
3) Log off  

**Choice:** 2

You should try: **Dune (1984)!**  
It has a rating of 4.1

---

**[Main Menu]**
1) Movie Info  
2) Recommend a Good Movie  
3) Log off  

**Choice:** 3

Goodbye!

---

### Explanation

- **Main Menu Options:** Users can select from three actions:
  1. Retrieve information about a specific movie.
  2. Receive a movie recommendation.
  3. Log off from the system.

- **Invalid Input Example:** Entering an invalid index (e.g., 100) results in an error message.

- **Valid Movie Selection Example:** Selecting index 0 retrieves details about "Back to the Future," rating it 5.0.

- **Recommendation Feature:** Choosing to be recommended a movie suggests "Dune (1984)" with a rating of 4.1.

- **Ending the Session:** Selecting option 3 logs the user off with a "Goodbye!" message.
Transcribed Image Text:### Text Transcription for Educational Use --- **[Main Menu]** 1) Movie Info 2) Recommend a Good Movie 3) Log off **Choice:** 1 **Which movie do you want?** 100 Sorry, that’s not a valid Movie index --- **[Main Menu]** 1) Movie Info 2) Recommend a Good Movie 3) Log off **Choice:** 1 **Which movie do you want?** 0 0. Back to the Future, 1985 - **Genre:** Science-Fiction - **Rating:** 5.0 --- **[Main Menu]** 1) Movie Info 2) Recommend a Good Movie 3) Log off **Choice:** 2 You should try: **Dune (1984)!** It has a rating of 4.1 --- **[Main Menu]** 1) Movie Info 2) Recommend a Good Movie 3) Log off **Choice:** 3 Goodbye! --- ### Explanation - **Main Menu Options:** Users can select from three actions: 1. Retrieve information about a specific movie. 2. Receive a movie recommendation. 3. Log off from the system. - **Invalid Input Example:** Entering an invalid index (e.g., 100) results in an error message. - **Valid Movie Selection Example:** Selecting index 0 retrieves details about "Back to the Future," rating it 5.0. - **Recommendation Feature:** Choosing to be recommended a movie suggests "Dune (1984)" with a rating of 4.1. - **Ending the Session:** Selecting option 3 logs the user off with a "Goodbye!" message.
Expert Solution
steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY