CSC435 OctFeb2023 Assignment
CSC435 OctFeb2023 Assignment
CSC435 OctFeb2023 Assignment
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:
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.
CEMPAKA HOSPITAL
PATIENT BILLING STATEMENT
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
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
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.
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).
Student name:
1)
2)
20
3)
4)
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
1 2 3 4
1 2 3 4
Robustness The program shows its ability to handle any possibility of users’
erratic interaction