Midterm InLab Exercise L1
Midterm InLab Exercise L1
Fall 2021-22
Mid-term In-Lab Exercise
Note: This mid-term lab is shorter than your regular lab. You should only take 40
minutes to solve it.
Note: MOSS will be used for plagiarism checking and a detailed viva will be conducted. A
final warning for cheating has already been issued so your case will immediately be
forwarded to the Disciplinary Committee if you cheat or are unable to explain your
solution. You would be wise to not cheat.
Lab Guidelines
1. You must put all your work into a folder named MidLab_YourRollNo (e.g,
MidLab_22100063), compress it into a “zip” file and submit the zip file on LMS
(Assignment -> Mid-term In-Lab) before Monday, 20th October 11:50 AM. No late
submissions or email submissions will be accepted.
2. Communicating with each other is NOT permitted. Searching for answers or help on
the internet is not permitted. All help material provided in the Lab Manual is allowed.
If you have a question, ask the TAs on Slack in your lab section channel.
3. The object is not simply to get the job done, but to get it done in the way that is asked
for in the lab. The objective is not just to get the code working, but to have a deep
understanding of why it is working.
4. Any cheating case will be reported to the Disciplinary Committee without any delay.
5. Failure to adhere to the naming convention of the file will result in 2.5 marks deduction.
6. Failure to adhere to coding conventions of the file will also result in 2.5 marks
deduction.
Remember Lab04 when we asked you to encode your name from English alphabets to ASCII
codes?
You also solved a lab in which you had to send a secret message to your sibling, and you had to
encode the message’s alphabets in ASCII.
In this lab, you will do the reverse. You will write a program that takes ASCII codes and outputs
the real alphabets of the message. This will help your sibling understand what you are saying.
Program Working
Download “Task1 Demo.mp4” video from LMS assignments. It’s a tiny 140Kb file. It demonstrates
the output of the program. You can also watch it on Google Drive online.
Note: This program requires only 10 lines of code in the main() function. It’s very simple if you
have practiced these concepts with practice problems.
Note: Assume that the user only enters valid ASCII codes. No need to handle cin.fail() or
double values or the case when the ASCII code is wrong.
Estimated Time: 30
Task 2 35 marks
minutes
Write a calculator app that runs as long as the user wants it to. The calculator app can add
numbers, multiply them, subtract them, or divide them, depending on what the user wants. The
user can also add or multiply as many numbers as (s)he wants. However, for subtraction and
division, the user can only input two numbers.
Program Working
Please download “Task2 Demo.mp4” file from LMS Assignments tab. It shows you how the output
of Task 2 should look like. It’s a tiny file less than 2Mb in size. You can also watch it online on
Google Drive by using this link.
Tips
• No need to use cin.fail(). Assume that the user only inputs integers.
• Your program should keep working as long as the user doesn’t manually end it by entering
“5” in the main menu. Use a while loop for this.
• Do not hesitate to use while loops and if-else statements inside each other (in a nested
fashion) as discussed in tutorials and lectures.
Grading Breakup