1.3 Given the following class named Furniture. Class name : Furniture /l e.g. chair, bed, table lle.g. wood, rattan Attributes : String furnitureType; String material; double pricePerUnit; int...


Java-OOP


1.3<br>Given the following class named Furniture.<br>Class name : Furniture<br>/l e.g. chair, bed, table<br>lle.g. wood, rattan<br>Attributes<br>: String furnitureType;<br>String material;<br>double pricePerUnit;<br>int quantity;<br>Method<br>: constructor, mutator, accessor, processor, printer<br>a) Write the definition of the following methods:<br>i. Default/Normal/Copy Constructor.<br>ii. Mutator/Setter for each attribute.<br>iii. Getter/Accessor/Retriever for each attribute.<br>iv. A Processor method named calcPriceFurniture () to calculate and<br>returns the price of furniture. The price is calculated based on the price per<br>unit, quantity and the discount rates depend on the material types as shown<br>in the following table:<br>Material Type<br>Discount Rate<br>20%<br>15%<br>Wood<br>Rattan<br>Metal<br>10%<br>Bamboo<br>5%<br>v. A printer method named tostring () to return the objects' information.<br>b) Write an application program to do the following tasks:<br>i. Declare an array of object named arrFurniture and store some data<br>onto array.<br>ii. To calculate and display the total price of furniture for each type of material.<br>ii. To determine the highest price of wood and display the details of<br>information.<br>

Extracted text: 1.3 Given the following class named Furniture. Class name : Furniture /l e.g. chair, bed, table lle.g. wood, rattan Attributes : String furnitureType; String material; double pricePerUnit; int quantity; Method : constructor, mutator, accessor, processor, printer a) Write the definition of the following methods: i. Default/Normal/Copy Constructor. ii. Mutator/Setter for each attribute. iii. Getter/Accessor/Retriever for each attribute. iv. A Processor method named calcPriceFurniture () to calculate and returns the price of furniture. The price is calculated based on the price per unit, quantity and the discount rates depend on the material types as shown in the following table: Material Type Discount Rate 20% 15% Wood Rattan Metal 10% Bamboo 5% v. A printer method named tostring () to return the objects' information. b) Write an application program to do the following tasks: i. Declare an array of object named arrFurniture and store some data onto array. ii. To calculate and display the total price of furniture for each type of material. ii. To determine the highest price of wood and display the details of information.

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here