CS110
Assignment #1
Total marks 8
Instructions:
Write your name and ID on top of your solution.
Use Word or any other application to do your solution then save at as PDF. Submit your file as PDF.
Submit your assignment as a single pdf file in Blackboard.
You do not need to copy the questions. Just write the question number and then your answer (for example, Q1.a, Q1.b, Q2.b...).
For programs, copy your CPP code and use a proper format.
Do not copy the solution from a friend or from the internet. If you copy you will get a zero mark in this assignment.
Submit your solution before deadline (28.03.24).
Assignment questions:
Modify this code:
/#include
/#include
/#include
using namespace std;
else if
else if x<= 9 cout << "from 8 to 9"<< endl;
else{
else { cout << "from 0 to 4 "<< endl;
break;
case 11...20: cout << "you entered a 11 to 20
"; break;
case 21...30 cout << "you entered a 21 to 30!
"; break;
case 31... 40: cout << "you entered a 31 to 40!
"; break;
default: cout << "Invalid number!
"; break;
return 0;
a. Change whole code from switch to if statements with some changes like: i. If the number is more than 35 and less than or equal 40; the program should ask the user to enter his or her name and ID and then print this information into the output screen. i. Learn how to use string data type.
ii.
If the number is more than 21 and less than 27, the program should ask the user to enter a number then display the power of the entered number.
iii.
What is the meaning of (... ) in the Switch? Explain in few words.
iv.
If the number is between 21 and 30: i. Ask the user to enter 2 numbers and calculate the maximum number entered
b. After you finish answering a, draw a simple flowchart for your program