You are on page 1of 2

Semester March 2020

CSC1511
Computer Programming

Tutorial 1

1. Which variables below are syntactically correct?


a) income
b) 1time
c) intTom’s
d) Two fold
e) c3po
f) income#1
g) item

2. What happen when you declare a variable?


A. The variable can no longer be used.
B. The data type can no longer be used.
C. The variable MUST be used in the program.
D. Memory is reserved for that variable.

3. What happen when you initialize a variable?


A. You make it constant for the first time.
B. The value is printed for the first time.
C. You give it a value for the first time.
D. You give it a value for the last time.

4. To store a character into a char variable, you must enclose it with _____.
A. Angled brackets
B. Single quote marks
C. double quote marks
D. Square brackets

5. To store a string into a String variable, you must enclose it with _____.
A. Angled brackets
B. Single quote marks
C. double quote marks
D. Square brackets
Semester March 2020
CSC1511
Computer Programming

6. Write a complete C++ program to display the following output:

**************************
ALI BABA’S RESTAURANT
**************************

1. Fried Mee Hoon RM 2.50


2. Fried Rice RM 3.20
3. Cold Drinks RM 1.50
4. Hot Drinks RM 1.00
**************************
PLEASE WELCOME
**************************

You might also like