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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:30, jcazares3558
Awell-diversified portfolio needs about 20-25 stocks from different categories.
Answers: 2
image
Computers and Technology, 23.06.2019 06:30, scoutbuffy2512
On early television stations, what typically filled the screen from around 11pm until 6am? test dummies test patterns tests testing colors
Answers: 1
image
Computers and Technology, 23.06.2019 10:00, thezbell
What is estimated time of arrival (eta)? a device that measures the acceleration (the rate of change of velocity) of an item and is used to track truck speeds or taxi cab speeds a gps technology adventure game that posts the longitude and latitude location for an item on the internet for users to find a north/south measurement of position the time of day of an expected arrival at a certain destination and is typically used for navigation applications
Answers: 3
image
Computers and Technology, 24.06.2019 00:20, talyku843
Describe a data structures that supports the stack push and pop operations and a third operation findmin, which returns the smallest element in the data structure, all in o(1) worst-case time.
Answers: 2
You know the right answer?
Write a program that achieves the same result as the following but uses a C++ switch statement inste...

Questions in other subjects:

Konu
Mathematics, 23.06.2019 16:00