Tasks: Write a BluRayDisk 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: 1.

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

Java language, create 4 separate classes based on the instructions.

+ BluRayDisk, DriverClass (Main class), Node, and Collection class.

 

Tasks:
1. Write a BluRayDisk 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. Write a node class which has a data field that holds a BluRayDisk and a next field which
is a link to another node.
3. Write a BluRayCollection 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 create 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 BluRays in the collection. It should utilize the toString or
ToString method to print each BluRay.
4. Write a main program which does the following:
a. Instantiate a BluRayCollection
b. Present the user with a menu that gives the following choices:
0. Quit
1. Add BluRay to collection
2. See collection
c. Read in the users choice. If they choose 1, prompt the user for a title, director,
of release and year, and call the add method in the BluRayCollection object
year
you created. If they choose 2, call the show_all method in the BluRayCollection
object you created.
Sample Output:
Ouit
Transcribed Image Text:Tasks: 1. Write a BluRayDisk 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. Write a node class which has a data field that holds a BluRayDisk and a next field which is a link to another node. 3. Write a BluRayCollection 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 create 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 BluRays in the collection. It should utilize the toString or ToString method to print each BluRay. 4. Write a main program which does the following: a. Instantiate a BluRayCollection b. Present the user with a menu that gives the following choices: 0. Quit 1. Add BluRay to collection 2. See collection c. Read in the users choice. If they choose 1, prompt the user for a title, director, of release and year, and call the add method in the BluRayCollection object year you created. If they choose 2, call the show_all method in the BluRayCollection object you created. Sample Output: Ouit
Sample Output:
0.
Quit
1.
Add BluRay to collection
2.
See collection
1
What is the title?
Jaws
What is the director?
Steven Spielberg
What is the year of release?
1975
What is the cost?
19.95
0.
Quit
1.
Add BluRay to collection
2.
See collection
2
$19.95 1975 Jaws, Steven Spielberg
0.
Quit
1.
Add BluRay to collection
2.
See collection
1
What is the title?
Jurassic Park
What is the director?
Steven Spielberg
What is the year of release?
1993
What is the cost?
17.99
0.
Quit
1.
Add BluRay to collection
2.
See collection
2
$19.95 1975 Jaws, Steven Spielberg
$17.99 1993 Jurassic Park, Steven Spielberg
Quit
1.
Add BluRay to collection
2.
See collection
Transcribed Image Text:Sample Output: 0. Quit 1. Add BluRay to collection 2. See collection 1 What is the title? Jaws What is the director? Steven Spielberg What is the year of release? 1975 What is the cost? 19.95 0. Quit 1. Add BluRay to collection 2. See collection 2 $19.95 1975 Jaws, Steven Spielberg 0. Quit 1. Add BluRay to collection 2. See collection 1 What is the title? Jurassic Park What is the director? Steven Spielberg What is the year of release? 1993 What is the cost? 17.99 0. Quit 1. Add BluRay to collection 2. See collection 2 $19.95 1975 Jaws, Steven Spielberg $17.99 1993 Jurassic Park, Steven Spielberg Quit 1. Add BluRay to collection 2. See collection
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
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