Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You have been approached to design a java application for a local retailer The Merplier Crazy Lolly Shop. It is envisioned that this java application

You have been approached to design a java application for a local retailer The Merplier Crazy Lolly Shop. It is envisioned that this java application will track the details of employees, customers, and suppliers. The CEO wants a design, documentation, and code of a simple version of the java application.

1. Design and Documentation

Purpose of system Explain  what the following application will do  implementation.

Class Diagrams

In this section, you are to provide a class diagram for every user-authored class of the system. You are expected to use inheritance so that you have parent class and child classes.

2. Coding

Create  new project in Eclipse called Assessment 2. Within this project create package called lollyShopSystem. You then must design the classes and include the following:

1. Author the following classes within your newly created package:

a. LollyShopDriver - which will be used to run the application. This class will have a main method.

b. Person - this is an parent class and includes the following attributes

i. firstName (String)

ii. surname (String)

iii. phoneNumber (String)

iv. discount (int)

c. Customer - which will inherit from Person and includes the following attributes

i. emailAddress (String)

 ii. And an additional attribute of your choice.

d. Employee - which will inherit from Person and includes the following attributes

 i. hourlyWorked (double)

 ii. And an additional attribute of your choice.

e. Supplier - which will inherit from Person and includes the following attributes

i. companyName(double)

 ii. supplierStatus (String)

iii. And an additional attribute of your choice

2. Provide at least two constructors for the Employee, Supplier and Customer classes:

 i. A default constructor which assigns each instance variable a default value

 ii. A constructor with parameters which assign values to each instance variable.

 3. Write get and set methods for your classes for all instance variables.

4. Write  toString() method in each class that will return a String containing all the relevant data for each of your objects. Use get methods to write toString() method. Use the format below in screenshot to display the details.

5. In the Customer, Employee and Supplier classes, create setDiscount() methods. Every group of people have different discount amounts and they are:

 a. Employees get a discount based on their hours worked. If an employee works less than 20 hours, they get 5% discount, if they work between 21-30hours they get a 10% discount and if they work more than 30 hours they get a 15% discount

b. Customers do not get any discount.

c. Suppliers get discount according to their status. If status is "Active", then 15% discount and if status is "past supplier" then 5% discount and if status is "Future supplier" then 10% discount.

6. In lollySHopDriver class, provide a main method that will do the following:

a. Create two objects of Employee with different details. One object using parametrised constructor and one using setMethods().

b. Create two objects of Customer with different details. One object using parametrised constructor and one using setMethods().

 c. Create two objects of Supplier with different details. One object using parametrised constructor and one using setMethods().

Step by Step Solution

3.32 Rating (146 Votes )

There are 3 Steps involved in it

Step: 1

Answer Personjava public class Person private String firstName surName phoneNumber private int discount public Person thisfirstName thissurName thisphoneNumber thisdiscount 0 public PersonString first... blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Business Research Methods

Authors: Donald R. Cooper, Pamela S. Schindler

12th edition

9780077774431, 0073521507, 77774434, 978-0073521503

More Books

Students also viewed these Programming questions

Question

2. Speak in a firm but nonthreatening voice.

Answered: 1 week ago

Question

Define Administration and Management

Answered: 1 week ago

Question

Define organisational structure

Answered: 1 week ago

Question

Define line and staff authority

Answered: 1 week ago

Question

Define the process of communication

Answered: 1 week ago

Question

Explain the importance of effective communication

Answered: 1 week ago

Question

How would you draw a cluster sample for the CityBus project?

Answered: 1 week ago