Assume the following code: string jollyR; int appleCnt =0, raspCnt = 0, grapeCnt = 0; cout <
Fantastic news! We've Found the answer you've been seeking!
Question:
Assume the following code:
string jollyR;
int appleCnt =0, raspCnt = 0, grapeCnt = 0;
cout << “Favorite Jolly Rancher Flavor: G for Green Apple, R for Raspberry?”;
cin >> jollyR;
Write a cascading decision statement to test the value contained in jollyR. If the value in jollyR
- Is equal to “G”, add 1 to the appleCnt variable
- Is equal to “R”, add 1 to the raspCnt variable
- Is equal to anything else, add 1 to the grapeCnt variable
Related Book For
Posted Date: