Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a class Store which includes the attributes: store name, city. Write another class encapsulating a Pharmacy, which inherits from Store. A Pharmacy has the

Write a class Store which includes the attributes: store name, city. Write another class encapsulating a Pharmacy, which inherits from Store. A Pharmacy has the following additional attributes: how many prescriptions are filled each week and the number of pharmacy patients.

Code the constructor, accessors, mutators, toString and equals method of the super class Store. Code the constructor, accessors and mutators for the subclass Pharmacy. In the Pharmacy class, also code a method returning the average number of prescriptions per patient for a week.

You should create a test class which creates 2 Pharmacy objects, then call your set methods, get methods, toString and equals methods and method to calculate the average number of prescriptions per patient for the Pharmacy objects.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions