Create an abstract NewspaperSubscription class with fields for the subscriber name, address, and rate. Include get and set methods for the name field and get methods for the address and subscription...

1 answer below »

Create an abstract NewspaperSubscription class with fields for the subscriber name, address, and rate. Include get and set methods for the name field and get methods for the address and subscription rate; the setAddress() method is abstract.


Create two subclasses named PhysicalNewspaperSubscription and OnlineNewspaperSubscription. The parameter for the setAddress() method of the PhysicalNewspaperSubscription class must contain at least one digit; otherwise, an error message is displayed and the subscription rate isset to 0. If the address is valid, the subscription rateis assigned $15. The parameter for the setAddress() method of the OnlineNewspaperSubscription class must contain an at sign (@) or an error message is displayed. If the address is valid, the subscription rateis assigned $9. finally write an application that declares several objects of both subscription subtypes and displays their data

Answered Same DayApr 10, 2021

Answer To: Create an abstract NewspaperSubscription class with fields for the subscriber name, address, and...

Valupadasu answered on Apr 10 2021
147 Votes
.idea/codeStyles/codeStyleConfig.xml




.idea/description.html
Simple Java application that includes a class with main() method
.idea/encoding
s.xml




.idea/misc.xml







.idea/modules.xml






.idea/project-template.xml

IJ_BASE_PACKAGE
.idea/workspace.xml



































































1586523594608


1586523594608

























New Proj.iml









out/production/New Proj/com/Driver.class
package com;
public synchronized class Driver {
public void Driver();
public static void main(String[]);
}
out/production/New Proj/com/NewspaperSubscription.class
package com;
public abstract synchronized class NewspaperSubscription {
private String name;
private String address;
private int rate;
public void NewspaperSubscription();
public String getName();
public void...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here