Problem 14
Question
Perform each of these steps: a. Read the problem statement. b. Formulate the algorithm using pseudocode and top-down, stepwise refinement. c. Write a \(C++\) program. d. Test, debug and execute the \(C++\) program. Develop a \(C++\) program that will determine whether a department-store customer has exceeded the credit limit on a charge account. For each customer, the following facts are available: a. Account number (an integer) b. Balance at the beginning of the month c. Total of all items charged by this customer this month d. Total of all credits applied to this customer's account this month e. Allowed credit limit The program should use a while statement to input each of these facts. calculate the new balance \((=\text { beginning balance }+\) charges credits) and determine whether the new balance exceeds the customer's credit limit. For those customers whose credit limit is exceeded, the program should display the customer's account number, credit limit, new balance and the message "Credit limit Exceeded.
Step-by-Step Solution
VerifiedKey Concepts
Understanding Pseudocode in C++ Programming
Mastering Loop Structures for Efficient Coding
Understanding Credit Calculations in Programming Context
Debugging Techniques for Accurate Code
- Running the program with different inputs to see if it behaves as expected.
- Using print statements to track variable values and program flow.
- Checking for incorrect variable initialization, especially in loops and conditional statements.