subject

When artists have a successful career, there is sometimes the need to collect all their works in an anthology album. Given main() and a base Album class, define a derived class called BoxSet. Within the derived Album class, define a printInfo() method that overrides the Album class' printInfo() method by printing not only the title, author, publisher, and publication date, but also whether it is the complete works, and number of discs. Ex. If the input is:
Master of Puppets
Metallica
Elektra
1986
The Complete Studio Albums
Creedence Clearwater Revival
Fantasy
27 Oct 2014
true
7
the output is:
Album Information:
Album Title: Master of Puppets
Author: Metallica
Publisher: Elektra
Publication Date: 1986
Album Information:
Album Title: The Complete Studio Albums
Author: Creedence Clearwater Revival
Publisher: Fantasy
Publication Date: 27 Oct 2014
Is Complete Works? true
Number of Discs: 7
AlbumInformation. java
import java. util. Scanner;
public class AlbumInformation {
public static void main(String[] args) {
Scanner scnr = new Scanner(System. in);
Album myAlbum = new Album();
BoxSet myBoxSet = new BoxSet();
String title, author, publisher, publicationDate;
String bTitle, bAuthor, bPublisher, bPublicationDate;
boolean isCompleteWorks;
int numDiscs;
title = scnr. nextLine();
author = scnr. nextLine();
publisher = scnr. nextLine();
publicationDate = scnr. nextLine();
bTitle = scnr. nextLine();
bAuthor = scnr. nextLine();
bPublisher = scnr. nextLine();
bPublicationDate = scnr. nextLine();
isCompleteWorks = scnr. nextBoolean();
numDiscs = scnr. nextInt();
myAlbum. setTitle(title);
myAlbum. setAuthor(author);
myAlbum. setPublisher(publisher);
myAlbum. setPublicationDate(publicationDate) ;
myAlbum. printInfo();
myBoxSet. setTitle(bTitle);
myBoxSet. setAuthor(bAuthor);
myBoxSet. setPublisher(bPublisher);
myBoxSet. setPublicationDate(bPublicationDate );
myBoxSet. setIsCompleteWorks(isCompleteWorks) ;
myBoxSet. setNumDiscs(numDiscs);
myBoxSet. printInfo();
}
}
Album. java
public class Album {
protected String title;
protected String author;
protected String publisher;
protected String publicationDate;
public void setTitle(String userTitle) {
title = userTitle;
}
public String getTitle() {
return title;
}
public void setAuthor(String userAuthor) {
author = userAuthor;
}
public String getAuthor(){
return author;
}
public void setPublisher(String userPublisher) {
publisher = userPublisher;
}
public String getPublisher() {
return publisher;
}
public void setPublicationDate(String userPublicationDate) {
publicationDate = userPublicationDate;
}
public String getPublicationDate() {
return publicationDate;
}
public void printInfo() {
System. out. println("Album Information: ");
System. out. println(" Album Title: " + title);
System. out. println(" Author: " + author);
System. out. println(" Publisher: " + publisher);
System. out. println(" Publication Date: " + publicationDate);
}
}
BosSet. java
public class BoxSet extends Album {
// TODO: Declare private fields: isCompleteWorks, numDiscs
// TODO: Define mutator methods -
// setIsCompleteWorks(), setNumDiscs()
// TODO: Define accessor methods -
// getIsCompleteWorks(), getNumDiscs()

// TODO: Define a printInfo() method that overrides
// the printInfo in Album class

}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 17:30
When making changes to optimize part of a processor, it is often the case that speeding up one type of instruction comes at the cost of slowing down something else. for example, if we put in a complicated fast floating-point unit, that takes space, and something might have to be moved farther away from the middle to accommodate it, adding an extra cycle in delay to reach that unit. the basic amdahl's law equation does not take into account this trade-off. a. if the new fast floating-point unit speeds up floating-point operations by, on average, 2ă—, and floating-point operations take 20% of the original program's execution time, what is the overall speedup (ignoring the penalty to any other instructions)? b. now assume that speeding up the floating-point unit slowed down data cache accesses, resulting in a 1.5ă— slowdown (or 2/3 speedup). data cache accesses consume 10% of the execution time. what is the overall speedup now? c. after implementing the new floating-point operations, what percentage of execution time is spent on floating-point operations? what percentage is spent on data cache accesses?
Answers: 2
question
Computers and Technology, 24.06.2019 11:20
Print "censored" if userinput contains the word "darn", else print userinput. end with newline. ex: if userinput is "that darn cat.", then output is: censoredex: if userinput is "dang, that was scary! ", then output is: dang, that was scary! note: if the submitted code has an out-of-range access, the system will stop running the code after a few seconds, and report "program end never reached." the system doesn't print the test case that caused the reported message.#include #include using namespace std; int main() {string userinput; getline(cin, userinput); int ispresent = userinput.find("darn"); if (ispresent > 0){cout < < "censored" < < endl; /* your solution goes here */return 0; }
Answers: 3
question
Computers and Technology, 24.06.2019 22:30
To include a watermark or page border on a word document, you will first need to navigate to the tab. file home insert design
Answers: 1
question
Computers and Technology, 25.06.2019 07:00
Afile named data.txt contains an unknown number of lines, each consisting of a single integer. write some code that creates two files, dataplus.txt and dataminus.txt, and copies all the lines of data1.txt that have positive integers to dataplus.txt, and all the lines of data1.txt that have negative integers to dataminus.txt. zeros are not copied anywhere.
Answers: 2
You know the right answer?
When artists have a successful career, there is sometimes the need to collect all their works in an...
Questions
question
Biology, 17.10.2021 18:50
question
English, 17.10.2021 18:50
question
Mathematics, 17.10.2021 19:00
question
World Languages, 17.10.2021 19:00
question
Mathematics, 17.10.2021 19:00
question
Mathematics, 17.10.2021 19:00
question
English, 17.10.2021 19:00
question
Biology, 17.10.2021 19:00
Questions on the website: 13722360