Professional Documents
Culture Documents
INSTRUCTION(S):
You are required to write a program in JAVA based on the problem description given. Read the
problem description and examine the sample of output; then study the program design given.
Using the problem-solving tips as a guide, write a complete program with necessary useful
comment for good documentation. Compile and execute the program.
ASSIGNMENT OBJECTIVE(S):
1. Learning objectives
a. To practice create class with multiple constructors.
b. To apply object-oriented programming concept by producing a small program in JAVA
2. Learning outcomes:
a. Able to analyze small-domain system requirement.
b. Able to produce an executable program using JAVA following object-oriented approach
c. Demonstrate capability to create classes and constructors, declare objects and methods,
use object and methods’ call.
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 Description Discount
00 Womens 20%
11 Mens 35%
22 Sportswear 50%
33 Kids No discount
Page 1 of 2
September 9, 2018 OBJECT-ORIENTED PROGRAMMING – CS102]
SAMPLE OF OUTPUT:
-------------------------------------------------------------------
Description Quantity Price Total After Discount
Womens 2 100 $200.00 $160.00
-------------------------------------------------------------------
Description Quantity Price Total After Discount
Mens 1 100 $100.00 $65.00
Page 2 of 2