subject

Write a program that achieves the same result as the following but uses a C++ switch statement instead. #include
int main()

{
int iNum= 0;
char cLetter= ' ';

std::cout << "Please enter a letter: ";
std::cin >> cLetter < 'c')

if ( cLetter > 'a' && cLetter < 'c')
iNum= 1;

else if ( cLetter== 'd' || cLetter == 'e' || cLetter== 'f')
iNum= 2;
else if (!(cLetter== 'b') && !(cLetter == 'g' && cLetter== 'c')
iNum=3;
else
iNum=4;

std::cout << iNum << std::endl;
system("Pause");
return 0;

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:10
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it must not appear in the factorization. sample runs are given below. note that if the power of a prime is 1, then that 1 must appear in t
Answers: 3
question
Computers and Technology, 22.06.2019 06:50
Type the correct answer in the box. spell all words correctly. which view of report creation allows you to customize the report before the database program creates it? creating a report in allows you to customize the report before the database program creates it. pl asap
Answers: 1
question
Computers and Technology, 22.06.2019 11:00
When building customer relationships through email what should you not do? question 2 options: utilize proper grammar, spelling, and punctuation type in all capital letters use hyperlinks rather than attachments respond to all emails within 24 hours
Answers: 1
question
Computers and Technology, 22.06.2019 17:30
Where would you click to edit the chart data?
Answers: 1
You know the right answer?
Write a program that achieves the same result as the following but uses a C++ switch statement inste...
Questions
question
Mathematics, 19.08.2021 21:20
question
Social Studies, 19.08.2021 21:20
question
Mathematics, 19.08.2021 21:20
question
Mathematics, 19.08.2021 21:20
question
English, 19.08.2021 21:20
question
Mathematics, 19.08.2021 21:20
question
Mathematics, 19.08.2021 21:20
question
English, 19.08.2021 21:20
question
English, 19.08.2021 21:20
Questions on the website: 13722367