Question: Draw a series of variable diagrams for the program below using the conventions of the Study Guide. Assume that the following input is given:
Draw a series of variable diagrams for the program below using the conventions of the Study Guide. Assume that the following input is given: 2010 t 1 #include 2 #include 3 using namespace std; 4 int main () 5 8 9 ( 6 7 10 11 12 13. 14 15 16 17 in bi 7890HN N N N N N N N N NTTE 18 19 20 21 22 23 24 25 26 27 28 29 30 ww 31 int year; char code; bool book = true; float discount = 0.20; 35 36 } cin >> year >> code; switch (year) ( true; 32 33 34 case 2008: case 2009: if (code == 'c') if (!book) case 2010: break; if (book) discount += 0.20; case 2011: if else return 0; if (code == 't') { default: book= false; code = 'g'; (discount > 0.20 11 code == discount = 0.15; discount += 0.10; discount = 0.25; code = 'b'; book = 'g') } discount = 0.35; cout < < year < < " " < < code < < "" < < book < < " " < < discount < < endl;
Step by Step Solution
There are 3 Steps involved in it
To draw a series of variable diagrams for the given program well use the conventions of the Study Gu... View full answer
Get step-by-step solutions from verified subject matter experts
