Question: Consider the following class: public class Store { public final double SALES_TAX_RATE = 0.06; private String name; public Store( String newName) { setName (newName); }

Consider the following class:

public class Store

{

public final double SALES_TAX_RATE = 0.06;

private String name;

public Store( String newName)

{

setName (newName);

}

public String getName()

{

return name;

}

public void setName(String newName)

{

Name = newName;

}

public String toString()

{

return ( "name: " + name );

}

}

Write a class (WebStore) encapsulating a web store, which inherits from class Store. A web store has the following additional attributes: an Internet address and the programming language in which the website was written. Code the constructor and the toString method of the new class. You also need to include a client class to test your code.

Write a class (GroceryStore) encapsulating a grocery store, which inherits from class Store. A grocery store has the following additional attributes: annual revenues and whether it is an independent store or part of a chain. Code the constructor and the toString method of the new class, also code a method returning the annual taxes paid by the store. You also need to include a client class to test your code.

Note: code must be written in Java. topic is inherritange

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!