You are on page 1of 4

ASSIGNMENT - GROUP (20%)

OBJECT ORIENTED PROGRAMMING (CSC435)


Semester October 2022 – February 2023

Question 1

Cempaka Hospital needs a program to compute and print a billing statement for each patient
and the hospital's total income for that day. Charges for each day are as follows:

a) Room charge depends on the room type.

Room Type Charge per day (RM)


Private Room (P) 180
Semi-private Room 120
(S)
Ward (W) 75

b) Telephone charge if the patient uses this facility is RM1.75 per day.
c) If the patient requests this facility in his/her room, the television charge is RM3.50 per
day.

Get the data from the user, compute the patient's bill and print an appropriate billing
statement.

Sample input is:


5 which means 5 days (assume the user enters a number more than 0)
P which means Private room type (assume user enters Uppercase)
N which means does not use the telephone facility (Y, y, N or n)
Y which means uses the television facility (Y,y, N or n)

Output for the sample input given:-

CEMPAKA HOSPITAL
PATIENT BILLING STATEMENT

Number of Days in Hospital : 5 days


Type of Room : P (Private- Room)

Room Charge : RM 900.00


Telephone Charge : RM 0.00
Television Charge : RM 17.50
TOTAL DUE : RM 917.50

The main menu consists of 2 options: the first is to Compute and print billing statement(C)
and the second is to Quit (Q). Repeat the process until the user chooses to Quit. Print
appropriate message errors if the user enters the wrong choice.

CEMPAKA HOSPITAL
MAIN MENU
1) C – Compute and Print Bill
2) Q – Quit
Enter your choice? Q

If Quit (Q), the program will print the total income for that day. Sample output:

CEMPAKA HOSPITAL
INCOME SUMMARY
Total Room Charge : RM 3500.00
Total Telephone Charge : RM 185.50
Total Television Charge : RM 486.20
TOTAL INCOME : RM 4171.70

YOU ARE REQUIRED TO:

a) Identify the output, input, and process for the above problems.
b) Using the specification obtained in (a), write pseudocode to illustrate the algorithm of
getting the inputs, processes, and outputs.
c) Write a Java program based on (b).
Question 2

A student council held a fund-raising campaign for MAKNA (Cancer Association) at a


particular university. A total of 30 students participate in this campaign.

You need to write a program that will input the student's faculty and he/her contribution
amount to MAKNA. The program then will calculate the number of faculty contributors, the
total amount contributed for each faculty, and the average contribution for each faculty.

There are only three faculties involved: Computer, Business and Policy. Your program must
also care if the user enters the wrong faculty name.

The sample screen output is as follows:-

Faculty Total Amount of contribution Number of contributions Average

1) Computer RMxxxxxx.xx xxx RMxxxxx.xx

2) Business RMxxxxxx.xx xxx RMxxxxx.xx

3) Policy RMxxxxxx.xx xxx RMxxxxx.xx

YOU ARE REQUIRED TO:

a) Identify the output, input, and process for the above problems.
b) Using the specification obtained in (a), write pseudocode to illustrate the algorithm of
getting the inputs, processes, and outputs.
c) Write a Java program based on (b).

Instruction to the students (Please read carefully and thoroughly):

 This assignment must do in a group of three/four. No single/individual submitted assignment


should be accepted.
 Provide the problem solution with the pseudocode. Write the pseudocode in Word.
 Compile the works in proper report format.
 Please submit the assignment together with the front-page cover and scoring rubric, which
provided.
 Create jar file before submit for the java coding.
 Please submit your coding (jar file format), pseudocode (Word format) with proper front-page
cover and scoring rubric. Compile all the files in zip format and give name for example,
Razul&Adek_Assign.zip
 Please write group members' names in the Readme file in BlueJ.
 Late submission and plagiarism were penalized, and marks deducted.
 The due date for submission is on week 7. As a reminder, late submission will be
penalized. Those who do not submit their assignment will not give any marks.

Assignment questions prepared by:

Razulaimi Razali and team


Universiti Teknologi MARA
Scoring Rubric (CSC435)

Student name:

1)

2)
20
3)

4)

Examiner Signature : _______________________


Examiner : Razulaimi Bin Razali
Date : _______________________

Marking Scheme

Remarks
Category
Weak Moderate Good Very Good
1 2 3 4
Defining and designing the
program Output, input and process is correctly identified.
Algorithm (pseudo-code) is correctly written.

1 2 3 4

Interface
Interface is neat and well organized

1 2 3 4

Run without error


Runs smoothly and without glitches

1 2 3 4

Correct Program is according to the original question and gives correct


output

1 2 3 4

Robustness The program shows its ability to handle any possibility of users’
erratic interaction

You might also like