Language is C++ Rare Collection. We can make arrays of custom objects just like we’ve done  with ints and strings. While it’s possible to make both 1D and 2D arrays of objects (and more), for this assignment we’ll start you out with just one dimensional arrays:  directions as follows in the pictures

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter5: Making Decisions
Section: Chapter Questions
Problem 8PE
icon
Related questions
Question

Language is C++

Rare Collection. We can make arrays of custom objects just like we’ve done 
with ints and strings. While it’s possible to make both 1D and 2D arrays of objects (and more), for this assignment we’ll start you out with just one dimensional arrays:
 directions as follows in the pictures 

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
Transcribed Image Text: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
You have been commissioned to develop a program to digitally record a rare collection of
LaserDisc movies. You will start by creating a LaserDisc class. It should have the following
private attributes:
String movieTitle
int releaseYear
String genre
float rating
Your class should also have the following methods:
• Default Constructor: Initializes the four attributes to the following default values:
o movieTitle = "Star Wars Holiday Special"
o releaseYear = 1978
o genre = "Science Fiction"
o rating = 5.0
• Overloaded Constructor: Initializes the four attributes based on values passed into the
formal parameters
• If rating is less than 0.0 or greater than 5.0, set it equal to 0.0
• If releaseYear is less than 1978, set it equal to 1978
bool/Boolean isltGood(): Returns "true" if rating is 3.0 or greater, and "false" otherwise.
Getter method for all class attributes
Transcribed Image Text:You have been commissioned to develop a program to digitally record a rare collection of LaserDisc movies. You will start by creating a LaserDisc class. It should have the following private attributes: String movieTitle int releaseYear String genre float rating Your class should also have the following methods: • Default Constructor: Initializes the four attributes to the following default values: o movieTitle = "Star Wars Holiday Special" o releaseYear = 1978 o genre = "Science Fiction" o rating = 5.0 • Overloaded Constructor: Initializes the four attributes based on values passed into the formal parameters • If rating is less than 0.0 or greater than 5.0, set it equal to 0.0 • If releaseYear is less than 1978, set it equal to 1978 bool/Boolean isltGood(): Returns "true" if rating is 3.0 or greater, and "false" otherwise. Getter method for all class attributes
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage