## Invitation to Computer Science 8th Edition

Published by Cengage Learning

# Chapter 2 - 2.2 - Representing Algorithms - Practice Problems - Page 51: 4

#### Answer

\begin{array}{l} {\text { Step }} & {\text { Operation }} \\ {\text { 1 }} & {\text { Get values for balance, the current credit card balance, for }} \\ {\text { }} & {\text { purchases, the total dollar amount of new purchases, and for }} \\ {\text { }} & {\text { payment, the total dollar amount of all payments }} \\ {\text { 2 }} & {\text { Set the value of unpaid to balance + purchases - payment }} \\ {\text { 3 }} & {\text { Set the value of interest to unpaid } \times 0.12} \\ {\text { 4 }} & {\text { Set the value of new balance to unpaid + interest }} \\ {\text { 5 }} & {\text { Print the value of new balance }} \\ {\text { 6 }} & {\text { Stop }} \end{array}

#### Work Step by Step

\begin{array}{l} {\text { Step }} & {\text { Operation }} \\ {\text { 1 }} & {\text { Get values for balance, the current credit card balance, for }} \\ {\text { }} & {\text { purchases, the total dollar amount of new purchases, and for }} \\ {\text { }} & {\text { payment, the total dollar amount of all payments }} \\ {\text { 2 }} & {\text { Set the value of unpaid to balance + purchases - payment }} \\ {\text { 3 }} & {\text { Set the value of interest to unpaid } \times 0.12} \\ {\text { 4 }} & {\text { Set the value of new balance to unpaid + interest }} \\ {\text { 5 }} & {\text { Print the value of new balance }} \\ {\text { 6 }} & {\text { Stop }} \end{array}

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.