Question
Tasks: 1. Make a BlueRayDisk class which has: a. Public attributes called title and director (strings), year of release (int) and cost (double). b. Constructor
Tasks:
1. Make a BlueRayDisk class which has:
a. Public attributes called title and director (strings), year of release (int) and cost
(double).
b. Constructor which takes in the 4 attributes and sets the objects variables.
c. Override of toString/ToString which prints the objects variables as follows:
[Dollar sign]Cost [space] Year of release [Space] Title [comma] Director
$19.99 2019 Avengers - Endgame, Anthony Russo & Joe Russo
2. Make a node class which has a data field that holds a BlueRayDisk and a next field which
is a link to another node.
3. Make a BlueRayCollection class which has:
a. A private link called head that links to a Node, it should be initialized to null
b. A public method called add() which takes 4 parameters (title, director, year of
release, cost) and returns nothing. It should make a new Node and add it to the
end of the linked list.
c. A public method called show_all() which takes no parameters and returns nothing,
but prints out all the BlueRays in the collection. It should utilize the toString or
ToString method to print each BlueRay.
4. Make a main program which does the following:
a. Instantiate a BlueRayCollection
b. Present the user with a menu that gives the following choices:
0. Quit
1. Add BlueRay to collection
2. See collection
c. Read in the users choice. If they choose 1, prompt the user for a title, director,
year of release and year, and call the add method in the BlueRayCollection object
you created. If they choose 2, call the show_all method in the BlueRayCollection
object you created.
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