You are on page 1of 2

LAB 2: EXERCISE

(Section 2)
Total = 100 marks

Task 1: [10 marks]


Write a C++ program to introduce yourself by providing brief details, e.g your name, age,
school, and address etc. All the information should be in the form of string and must be
displayed on the screen in a presentable manner.

Task 2: [30 marks]


Write a program that prints out C S ! in large block letters inside a border of *s followed by two
blank lines then the message Computer Science is Cool Stuff. The output should look as follows:
Task 3: [30 marks]
Write a program which prints the list of first 10 even numbers in the following manner:
Number 1: 2
Number 2: 4
Number 3: 6
Number 4: 8
Number 5: 10
Number 6: 12
Number 7: 14
Number 8: 16
Number 9: 18
Number 10: 20
Note: All the numbers should not be printed as a string. You must need to print the actual
numbers. But, all the numbers should be formed in the following way:
Number 1: 2*1
Number 2: 2*2
Task 4: [30 marks]
You are given a task to compute the total number of candies in possession of a shopkeeper.
Now the situation is that candies are equally divided in different glass jars. To do this task you
must need to gather the following information form the shopkeeper first:
- Number of jars
- Number of candies per jar
After calculating the total number of candies you must display it in the form of following
message:
If you have 4 jars
and
50 candies in each jar, then
you have 200 candies in all the jars.

You might also like