Computers and Technology

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;

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 08:00, luclaymom805
Aplan to budget time for studying and activities is referred to as a study routine. study habits. study skills. a study schedule.
Answers: 1
image
Computers and Technology, 22.06.2019 23:30, riah133
Creating "smart interfaces" in all sectors of industry, government, and the public arena is one of the fastest growing hct areas. these interfaces model, interpret, and analyze such human characteristics as speech, gesture, and vision. the field of biometrics, in which humans authenticate themselves to machines, is an area of considerable interest to hct practitioners. fingerprint scans are one of the most frequently used biometric options, and this article, biometric student identification: practical solutions for accountability & security in schools, makes a case for the implementation of fingerprint scans in schools. critique the article, and answer the following questions: according to the author, what are the main benefits of adopting fingerprint scans in schools for student identification? according to the author, what are the main drawbacks of adopting fingerprint scans in schools for student identification? do you agree with the author's assessment of the pl
Answers: 2
image
Computers and Technology, 23.06.2019 09:30, shadowsnake
Write a function called checkfactor that takes two arrays of positive numbers, firstnumberrow and secondnumberrow. checkfactor checks if the first entry in firstnumberrow is divisible by the first entry in secondnumberrow, and performs the same operation on the next array elements until all entries have been checked. all the numbers are positive and the number of entries in the arrays are the same. the function should return the identified divisible numbers in two row arrays named firstdivisible and seconddivisible. restrictions: branches or loops should not be used. the code must use the internal mod and logical functions. hint: the mod function should be used to determine if two numbers are divisible. ex: for num1 and num2 if mod(num1,num2) is 0, then the two numbers are divisible. this is matlab
Answers: 2
image
Computers and Technology, 23.06.2019 18:40, brooklyn4932
How does is make you feel when you're kind to others? what are some opportunities in your life to be more kind to your friends and loved ones? imagine a world where kindness has be outlawed. how would people act differently? would your day-to-day life change significantly? why or why not?
Answers: 2
Do you know the correct 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, 06.12.2020 19:20
Konu
English, 06.12.2020 19:20
Konu
Geography, 06.12.2020 19:20