Question: Java question A class named Newspaper is defined as shown in the class diagram. It has a super class named Serial Publication also defined as

Java question

Java question A class named Newspaper is defined as shown in the

class diagram. It has a super class named Serial Publication also definedas shown in the class diagram. The Newspaper class contains o An

A class named Newspaper is defined as shown in the class diagram. It has a super class named Serial Publication also defined as shown in the class diagram. The Newspaper class contains o An enum/enumeration type named Format with the value of broadsheet, tabloid and undefined. o A private instance variable format of type Format o A private instance variable name of type String o 3 constructors. o one constructor takes a String parameter name and sets the variable name to the value of this parameter. It calls the SerialPublication constructor without parameters which will set the frequency of the publication to the default value of undefined. It sets the value of format to undefined by calling the setFormat() method. o another constructor that takes two String parameters name and freq and uses them to set the values of the instance variable name and the inherited protected variable frequency. It sets the value of format to undefined by calling the setFormat() method. o a third constructor that takes three String parameters name, freq and format. It sets the instance variable name and the inherited variable frequency. It also sets the value of format by calling the setFormat() method. o A public method setFormat() that takes a String parameter and sets the instance variable format to the matching value in the enum. If there is no matching value in the enum, the method sets format to undefined o A get Format() method that returns the value of format in a lowercase String o A toString method that returns o if the frequency of the Newspaper is undefined: "[name] is a newspaper published with [frequency] frequency in [format] format" o if the frequency of the Newspaper is not undefined: "[name] is a [frequency] newspaper in [formatl format

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!