Question: please write a simple program in java and on bluej DESCRIPTIONS OF PROBLEM: DanaStore, a cloth department would like to have a cash register program


DESCRIPTIONS OF PROBLEM: DanaStore, a cloth department would like to have a cash register program that can calculate sale for the store. The store has 4 departments currently Spring Sale. Write a program contained a class CashRegister which has 4 attributes: department (type: int), description (type: String), discount (type: double) and total (type: double). Table 1 Department 00 11 22 33 I Description Womens Mens Sportswear Kids Discount 20% 35% 50% No discount SAMPLE OF OUTPUT: Enter item detail: Department: 00 Quantity: 2 Price : 100 Description Womens Quantity 2 Price 100 Total After Discount $200.00 $160.00 Another item? (Yes 1, No - 0): > 1 Enter item detail: Department: 11 Quantity: 1 Price : 100 Description Mens Quantity 1 Price 100 Total After Discount $100.00 $65.00 Another item? (Yes - 1, No - 6):> 0 Total purchase: $225.00 Exit. PROBLEM SOLVING TIPS: Num a) Tips Class Cash Reg with four attributes department, description, discount and total. Grade 72m b) Write a constructor than can perform initialization to all data members according to the data type and specification mentioned in Table 1. /2m /3m d) /3m public set and get method for all attributes. public method calTotal in which will assign value to total based on this formula total = total + quantity (price -price* discount) where price and quantity are from user. Main program which can create object instance and derive user input during execution with control of sentinel loop, determine the discount based on code entered, passed the value to method calTotal() to calculate total purchase as shown in output. f) 710m
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
