Question: #include #include using namespace std; int main() { int input; cout cin >> input; switch (input) { // Complete this switch statement in C++ }

 #include #include using namespace std; int main() { int input; cout

#include

#include

using namespace std;

int main() {

int input;

cout

cin >> input;

switch (input) {

// Complete this switch statement in C++

}

return 0;

}

You will write a program that uses a switch statement. First, have the user enter an integer as prompted below. If the number is 0 1, or 2 you should printNumber less than three if the number entered is , you should print "Number is three". If the number is 4,5, or 6, you should print "Number between three and seven If the number entered is 7 you should print, "Number is seven". For any other integer input your program should print, "Number outside of range", You should use as few cout statements as possible by carefully ordering your case statements within the switch and thinking about where to put "break" statemens, The Number outside of range cout statement should be in the default case of the switch statement. 1 point will be deducted for not using default properly, and 2 points will be deducted for having multiple cout statements that print the same thing. You must use a switch statement and will receive no credit if you use an if/else construct. Note that part of the code is started for you already Sample run 1 Enter a number 1ess than 8:1 Number less than three Sample run 2: Enter a number less than 8: 7 Number is seven

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!