Create a test program for the classes shown in part 1. Assume that all the classes are implemented and you can use all their methods. a. Create an array of 8 disks with 4 disks of type Audio created at even indices and 4 disks of type Video created at odd indices. The program will prompt the user to fill all the attributes. Write the code that prompts the user to enter the number of tracks to be added to each audio disk created in the array. Then, the program will prompt the user to enter the name of each track as a String. b. c. Write the code that displays the detailed information about each disk. d. Prompt the user to enter a title as a String. Then, display whether the title is found among the disks in the array. e. Write the code that displays a message (e.g. Disk 0 has to be burned.) if the audio disk contains less than 4 tracks. solve this only and thanks

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

plz asap java

1- Based on the UML shown below, Implement in Java the following inheritance hierarchy (the
classes' description comes next):
Disk
- title: String
- playTime: int // in minutes
+ Disk(title: String, playTime: int)
+ getTitle(): String
+ getPlayTime(): int
+ toString(): String
4
Audio
Video
director: String
artist: String
- tracksList: java.util.ArrayList
- description: String
+ Video(director: String, description:
+ Audio(artist: String, title: String,
playTime: int)
String, title: String, playTime: int)
+ getArtitst(): String
+ getDirector(): String
+ getTracksList()
+ getDescription(): String
+ addTrack(name: String): void
+ toString(): String
+ removeTrack(name: String): void
+ toString(): String
A. Disk class is characterized by a String attributes title and an integer playTime. This class has:
A constructor that initializes all the attributes.
The getter and setter methods for the attributes.
A toString() method that returns each data field at a line in the form:
"Title: " + title + "\nPlay time: " + playTime;
B. Audio class inherits the class Disk. It has a String artist and an array list tracksList. This class
has:
●
A constructor that initializes all attributes in which tracks List attribute has to be created.
The getter methods and setters for the attributes..
•
addTrack method that takes as parameter the name of the track to be added to the array.
removeTrack method that takes as parameter the name of the track to be deleted from the array.
A toString() method that overrides the toString() method in the Disk class by adding the data
fields of the Audio class in the same form.
C. Video class inherits the class Disk. It has as attributes two Strings director and description. This
class has:
A constructor that initializes all attributes.
A toString() method that overrides the toString() method in the Disk class by adding the data
fields of the Video class in the same form.
Create a test program for the classes shown in part 1. Assume that all the classes are implemented
and you can use all their methods.
a.
Create an array of 8 disks with 4 disks of type Audio created at even indices and 4 disks of
type Video created at odd indices. e program will prompt the user to fill all the attributes.
b. Write the code that prompts the user to enter the number of tracks to be added to each audio
disk created in the array. Then, the program will prompt the user to enter the name of each
track as a String.
C. Write the code that displays the detailed information about each disk.
d. Prompt the user to enter a title as a String. Then, display whether the title is found among
the disks in the array.
e. Write the code that displays a message (e.g. Disk 0 has to be burned.) if the audio disk
contains less than 4 tracks.
solve this only and thanks
Transcribed Image Text:1- Based on the UML shown below, Implement in Java the following inheritance hierarchy (the classes' description comes next): Disk - title: String - playTime: int // in minutes + Disk(title: String, playTime: int) + getTitle(): String + getPlayTime(): int + toString(): String 4 Audio Video director: String artist: String - tracksList: java.util.ArrayList - description: String + Video(director: String, description: + Audio(artist: String, title: String, playTime: int) String, title: String, playTime: int) + getArtitst(): String + getDirector(): String + getTracksList() + getDescription(): String + addTrack(name: String): void + toString(): String + removeTrack(name: String): void + toString(): String A. Disk class is characterized by a String attributes title and an integer playTime. This class has: A constructor that initializes all the attributes. The getter and setter methods for the attributes. A toString() method that returns each data field at a line in the form: "Title: " + title + "\nPlay time: " + playTime; B. Audio class inherits the class Disk. It has a String artist and an array list tracksList. This class has: ● A constructor that initializes all attributes in which tracks List attribute has to be created. The getter methods and setters for the attributes.. • addTrack method that takes as parameter the name of the track to be added to the array. removeTrack method that takes as parameter the name of the track to be deleted from the array. A toString() method that overrides the toString() method in the Disk class by adding the data fields of the Audio class in the same form. C. Video class inherits the class Disk. It has as attributes two Strings director and description. This class has: A constructor that initializes all attributes. A toString() method that overrides the toString() method in the Disk class by adding the data fields of the Video class in the same form. Create a test program for the classes shown in part 1. Assume that all the classes are implemented and you can use all their methods. a. Create an array of 8 disks with 4 disks of type Audio created at even indices and 4 disks of type Video created at odd indices. e program will prompt the user to fill all the attributes. b. Write the code that prompts the user to enter the number of tracks to be added to each audio disk created in the array. Then, the program will prompt the user to enter the name of each track as a String. C. Write the code that displays the detailed information about each disk. d. Prompt the user to enter a title as a String. Then, display whether the title is found among the disks in the array. e. Write the code that displays a message (e.g. Disk 0 has to be burned.) if the audio disk contains less than 4 tracks. solve this only and thanks
Expert Solution
steps

Step by step

Solved in 3 steps with 2 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