CS100 Computational Problem Solving Fall 2021-2022 Sarvech Qadir
CS100 Computational Problem Solving Fall 2021-2022 Sarvech Qadir
CS100 Computational Problem Solving Fall 2021-2022 Sarvech Qadir
Fall 2021-2022
Sarvech Qadir
Lab Guidelines
1. You are allowed to perform/submit the lab only during the lab timings
2. Make sure you do not leave the lab without submitting your work on LMS
3. Copying/sharing code is strictly prohibited. Using any unfair means will lead to immediate
disqualification
4. Put all cpp files into a folder YourRollNo_Lab2_TAname and submit it on LMS
(Assignments>Lab2)
5. Lab ends at 8:50 pm and the submission tab closes at the same time
Task1 Total
25
Task2 Total
25
Task3 Total
30
Hello, I am Ahmed.
My roll number is 22100110.
I am from Lahore.
__________________________________________________________________
1. Expected rainfall
2. Actual rainfall.
You need to store these values in int/double variables and display these
variables. You can only use 2 variables in the whole program. For example, there
will be a single variable for both expected average rainfall and actual average
rainfall, and so on. You will use variable assignments to change the values of these
variables to display your actual values once you have displayed the goal values.
Whether a variable should be an int or a double is for you to figure out, depending
upon what you have learnt in class.
Expected rainfall:
Number of days it will rain: 4
Average rainfall(mm): 250.6
Actual rainfall:
Number of days it rained: 2
Average rainfall(mm): 90.8
________________________________________________________________
Write a program that prints the character ‘A’, ‘R’, ‘M’ as shown below. You are
supposed to use escape sequences (table at the end of the document) wherever
possible. Full credit will only be provided to students who don’t violate the following
rules:
25 marks are for printing the characters correctly as shown below, and 5 marks are
for not violating the rules above.
___________________________________________________________________
\n New line
\\ backslash
\’ Single quote
\b Backspace
\t Tab (4 spaces)