## Invitation to Computer Science 8th Edition

Step 1 Set values of Cost and Total to 0 Step 2 Set value of count to 1 Step 3 While (count $\leq 12 )$ perform Steps 4 through 9 Step 4 Read in value for $M_{s}$ Step 5 Read in value for $M_{e}$ Step 6 Add $\left(M_{e}-M_{s}\right)$ to the value of Total Step 7 If $\left(\left(M_{e}-M_{s}\right) \leq 1000\right)$ then add $\left(\left(M_{e}-M_{s}\right) \cdot 6\right)$ to the value of Cost $\quad$ else Step 8 Add $\left(1000 \cdot 6+\left(\left(M_{e}-M_{s}-1000\right) \cdot 8\right) \text { to the value of } \text {Cost}\right.$ Step 9 Add 1 to the value of count Step 10 Print out "Your total annual charge is (Cost) dollars" Step 12 Stop