Question: Assume the following code: string jollyR; int appleCnt =0, raspCnt = 0, grapeCnt = 0; cout < < Favorite Jolly Rancher Flavor: G for Green
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
Step by Step Solution
There are 3 Steps involved in it
Heres an example of a cascading decision statement in C that tests the v... View full answer
Get step-by-step solutions from verified subject matter experts
