Professional Documents
Culture Documents
CSC430
What you should have in the project?
Implementation (coding)
-
Sample of input/output
Bind together all the items needed for the mini project.
Hand in your report and also the softcopy of your project (CD).
Marks will be deducted if your answers same with the other groups!!!
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)
: 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.
: 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:
QUESTION 3
The Bahagia Hospital is introducing the new ward rates for year 2012:
Type of ward
Class 1
Class 2
Class 3
90
70
50
120
90
70
Patient's age
The patient's category ('G' for government servant or 'N' for non
government servant)
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 .