You are on page 1of 7

MINI PROJECT (GROUP: 4-5 PERSONS/GROUP)

CSC430
What you should have in the project?

Analysis of the problem should be clarified.

Implementation (coding)
-

the effectiveness and the efficiency of the program will be considered


print out the source code

Sample of input/output

Brief biodata (include your picture) about members in the group.

Cover page of the mini project.

Bind together all the items needed for the mini project.

Hand in your report and also the softcopy of your project (CD).

Dateline: 26/06/2012 (EMD2M4A)

Dateline: 27/06/2012 (EMD2M1A)

Note: mark will be given based on the above requirement

Marks will be deducted if your answers same with the other groups!!!

Contact number: 013-9990890 (HP), 03-5521 1183 (Office)


FACULTY OF COMPUTER SCIENCES & MATHEMATICS (ROOM: T1-04 CS2)

QUESTION 1
A businessman has 3 maids, 2 gardeners and 2 drivers. Write a program that can
prepare a paid slip for every worker.
In the program, the data for each worker are as follows:
Personnel ID, KWSP number, Name, Position, and Salary.
Position are entered based on job as below:
1 maid
2- gardener
3- driver
Example of input:
Enter month: 10
Enter year: 2012
Personnel ID: 1104
Name: Nursyahida
KWSP number: 10312478
Position: 1
Salary: 445.67
Personnel ID: 0509
Name: Azri
KWSP number: 12345678
Position: 2
Salary: 395.90
(continue entering the data for all workers)

KWSP deduction : 9% from salary

The output should be as below:


Name: Nursyahida
Personnel ID : 1104
Month: October 2012
KWSP number: 10312478
Position: Maid
----------------------------------------------------------------------------------------------------------------Salary
KWSP deduction
Net Salary

: RM 445.67
: RM 40.11
: RM 405.56

*****************************************************************************************************
Name: Azri
Personnel ID : 0509
Month: October 2012
KWSP number: 12345678
Position: Gardener
----------------------------------------------------------------------------------------------------------------Salary
KWSP deduction
Net Salary

: RM 395.90
: RM 35.63
: RM 360.27

QUESTION 2
You are required to write a complete program that calculates the amount of water
used for a month that has been imposed by Jabatan Bekalan Air Malaysia. The
program should calculate the charges based on the following information:
i.
ii.
iii.

Total payment overdue


Past meter reading
Current meter reading

Given the charge rate as follows:


0 15 m3
15.1 40 m3
40.1 m3 and above

: RM0.82 every m3
: RM0.65 every m3
: RM0.42 every m3

The minimum charge is RM5.00. Although the amount of water usage for any
customer is less than RM5.00 the customer will be charged this minimum amount in
their bills. Your program should be able to print the charges for that month and the
overall total charges for each customer. Lastly, your program should display a report
regarding the number of customers served and total collection of that particular day.
Below is an output sample as a reference.

Sample of output:

Enter total payment overdue: 0


Enter past meter reading: 2452
Enter current meter reading: 2455
CURRENT CHARGE: RM 2.46
OVERDUE CHARGE: RM 0.00
TOTAL CHARGE : RM 5.00
Next customer? (y/n): y
Enter total payment overdue: 8.0
Enter past meter reading: 1456
Enter current meter reading: 1890
CURRENT CHARGE: RM 182.28
OVERDUE CHARGE: RM 8.00
TOTAL CHARGE : RM 190.28
Next customer? (y/n): y
Enter total payment overdue: 0
Enter past meter reading: 2345
Enter current meter reading: 2567
CURRENT CHARGE: RM 93.24
OVERDUE CHARGE: RM 0.00
TOTAL CHARGE : RM 93.24
Next customer? (y/n): n
*******REPORT SUMMARY*******
NO OF CUSTOMERS: 3
TOTAL COLLECTION: RM288.52

QUESTION 3
The Bahagia Hospital is introducing the new ward rates for year 2012:
Type of ward

Government Servant (RM)

Non government servant


(RM)

Class 1
Class 2
Class 3

90
70
50

120
90
70

Write a complete C++ program that performs the following:


a. Prompts and reads the input data below:

Patient's age

The type of ward (1, 2, or 3)

The patient's category ('G' for government servant or 'N' for non
government servant)

The number of days patient stay in the ward


b. Calculates the ward charges for a patient aged above 50 years. A patient who
is above 50 years will only be charged RM 15 per day. A pensioner who was a
government servant and aged above 55 years will only be charged RM 5 per
day.
c. Calculates the ward charges for a patient aged 50 years and below. A patient
aged 50 years and below will be charged according to the ward rates as given
in the above table. The ward charges are the ward rates multiply by the
number of days.
d. Prints the type of ward, patient's category and the ward charges.

QUESTION 4
Given the following C++ main() function of a program:
const float pie = 3.142;
main()
{
float radius;
char select;
cout << Enter the radius of a circle ;
cin >> radius;
cout << \nMenu;
cout << \nA calculate the area of a circle ;
cout << \nD calculate the diameter of a circle;
cout << \nYour selection: ;
cin >> select;
printAreaDiameter (select, radius);
return 0;
}
Write the function definition for printAreaDiameter() that calculates and displays
either area or diameter of a circle. Display an appropriate message if the selection
that has been passed to function is not A or D.Then, write the full program includes
the main and function definition.

QUESTION 5
You have been hired to work in a new private college. On your second week there,
you are instructed by the principal to write a full program that will enable the lecturers
to key in the students marks.
In the college each class is only limited to 20 students. The lecturers should be able
to key in the students marks into an array named MARKS (example of marks input
are: 89, 95, 72, 73, 99, 73, 86, 75, 92, 73, 79, 75, 50, 73).
As each mark is input, add the marks to total and determine the maximum and
minimum mark. After all marks are input and the total is obtained, calculate the
average of the marks .

You might also like