Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given the following Curtain and Dress subclasses are inherited from Tailorhouse superclass. Superclass : TailorHouse Attributes: String custNo // customer I/C number String custName //
Given the following Curtain and Dress subclasses are inherited from Tailorhouse superclass. Superclass : TailorHouse Attributes: String custNo // customer I/C number String custName // customer Name String date // date of order char Cust_type // regular customer or new customer // regular customer will be given 15% discount 1/ from total charges Abstract Method: public abstract double calcharges() // method to calculate the I/ charges Subclass : Dress Attributes: String dressType // Type of dress, Kebaya or Kurung or Jubah boolean silk; // either Yes or No to silk Details of charges are shown in the table below: a) Write the normal constructors for both sub classes (exclude the constants). (4 marks) b) Write an abstract methods of calcharges () to calculate the total charges for both subclasses. (7 marks) c) Assume the following code has been defined : Tailorhouse [ ] T= new Tailorhouse [25]; //consists of both subclasses objects Write a program fragment to determine and display the number of "kebaya ", "kurung" and "jubah" made by the tailor at TailorHouse. (5 marks) d) Write a program fragment to calculate and display the total charges of all regular customer who sent their curtain to the Tailorhouse. (4 marks) e) Assume that all classes have tostring () methods, write a program fragment to display the details information of Tailorhouse customers. (2 marks)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started