Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please answer this questions??!! QUESTION 6 Orked Chantek is a newly founded company that sells a range of skincare and cosmetic products. Currently they are

image text in transcribed

image text in transcribed

Please answer this questions??!!

QUESTION 6 Orked Chantek is a newly founded company that sells a range of skincare and cosmetic products. Currently they are selling their products to the appointed agents and walk-in customers. The company gives discounted price to both agents and walk-in customers based on certain conditions. Given the following superclass and subclasses. public class Order private String orderid; private String orderDate; //e.g: 25 Julai 2013 private int quantitySetA; //quantity sold for Set A private int quantitySetB; //quantity sold for Set B private int quantitySetc; //quantity sold for Set B final double PRICE SETA = 187.00; final double PRICE_SETB = 258.00; final double PRICE_SETC = 377.00; //a normal constructor, getters, a printer public double calculateGrossPrice) //calculate total price based on quantity and price for each set } public double calculateNet Price () { ...) } public class WalkInOrder extends Order private String phoneNo; 1ormal constructor, getters, a printer public double calculateNetPrice () {-} public class Agentorder extends Order private String agentId; /ormal constructor, getters, a printer public double calculateNet Price a) Write the implementation of calculateNet Price () for both subclasses. All walk-in customers with a total purchase of at least RM400 will receive 10% discount. For agents, discount is given based on total point as shown in the table below. Product Set A Set B Set C Point/set 72 85 110 Total point 200 450 700 Discount percentage 30% 35% 40% The total point is calculated using the following formula: Total point = (point Set A x quantity sold for Set A) + (point Set B x quantity sold for Set B) + (point Set C x quantity sold for Set C) (5 marks) b) In the main(), assume that an array named order has been created to store all order information for both agents and walk-in customers. Write Java program segments to: i) List all agent IDs who will not receive any discount. (5 marks) ii) Calculate and display total purchase amount made by all walk-in customers on 25th March 2013

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Practical Neo4j

Authors: Gregory Jordan

1st Edition

1484200225, 9781484200223

More Books

Students also viewed these Databases questions