Professional Documents
Culture Documents
Name: ID Group:: Quiz 1 TOPIC: Basic Elements of Computer Program
Name: ID Group:: Quiz 1 TOPIC: Basic Elements of Computer Program
Name:
ID
GROUP:
b. Declare three integer variables, prompt for user to enter three numbers and
read the numbers.
(2 marks)
2. What type of error when your code violates one or more of the grammar rules of
programming language?
(1 mark)
3. Suppose x, y and z are int variables and w and t are double variables. What value
is assigned to each of these variables after the last statement executes?
iii
5. ABC Private Parking is charging each customer a parking fee based on the number
of hours they park their vehicles. It is charge RM2 for the first 1 hour and RM1 per
hour for subsequent hours. Write a program to calculate the parking payment for a
customer. The program will prompt the customer to enter the car registration number,
date, and parking hours.
All the data entered will be displayed together with the parking fee as in the example
receipt: