You are on page 1of 2

Deadline: Nov 18, 2019 09:00 a.m.

Introduction to Computing
Assignment 3
Instructions
• Create separate file for each task. And name each file as task1.cpp, task2.cpp, task3.cpp ….
• Please follow the deadline. In case of late submission, marks will be deducted. On late submission of every
hour, 10% marks will be deducted.
• Submit assignment on LMS only in specified folder “Assignment 3 – Submission Folder”. No hard copy will be
accepted. Do not zip folder or submit folder. Only submit cpp files
• If plagiarism found, zero marks will be awarded. Consider this instruction as last warning, don’t ask for second
warning!

Question 1
Write a program in C++ that asks a user to enter exactly a 5-digit number. Display the number in words
Example

Please enter a number: 51908


Five One Nine Zero Eight

Question 2

Part A

Write a C++ program, that prompts a user to enter marks obtained in courses, you are studying in first semester, out of
100. Calculate the average of these marks and display the grade. Grading policy is
Score (out of 100) Grade
0 – 49.5 F
49.5 – 57.5 D
57.5 – 71.5 C
71.5 – 84.5 B
>= 84.5 A

Example

Please enter marks obtained in 5 courses: 89 92 47 78 93


Marks in 1st course 89
Marks in 2nd course 92
Marks in 3rd course 47
Marks in 4th course 78
Marks in 5th course 93
The average of 5 courses is 399 / 5 = 79.8
You got B grade in 1st semester

Question 3

Write a program in C++ that asks a user to enter two numbers. Find the maximum number and then display whether the
maximum number is even or odd.

Example

1
Deadline: Nov 18, 2019 09:00 a.m. Introduction to Computing
Assignment 3
Please enter two numbers: 89 92
The maximum number is 92
92 is even number

Question 4

We have seen telephone on numerical keypad. As we know QWERTY keypad is being used in every smartphone. A
company XYZ is looking for a solution through which a user can dial number using QWERTY keypad (A-Z). Write a program
that reads the letter codes A to Z, and prints the corresponding telephone digit. Asks a user to enter 7 digits.
Following is the chart given for conversion

1 1 P/Q/R/S 7
A/B/C 2 T/U/V 8
D/E/F 3 W/X/Y/Z 9
G/H/I 4 0 0
J/K/L 5 * *
M/N/O 6 # #

Example

Please enter 7 digits: D C L M 0 T R


The number you have entered is 3256087

Good Luck!

You might also like