Develop a C# app that will determine whether any of several de- partment-store customers has exceeded the credit limit on a charge account. For each customer, the following facts are available:
a) account number,
b) balance at the beginning of the month,
c) total of all items charged by the customer this month,
d) total of all credits applied to the customer’s account this month and
e) allowed credit limit.
The app should input all these facts as integers, calculate the new balance (= beginning balance +
charges – credits), display the new balance and determine whether the new balance exceeds the cus-
tomer’s credit limit. For those whose credit limit is exceeded, the app should display the message
"Credit limit exceeded". Use sentinel-controlled iteration to obtain the data for each account.
Top:
Determine if each of an arbitrary number of department store customers has exceeded the credit limit on a charge account
First refinement:
Input customer’s data
For each customer, calculate and display the customer’s new balance, and display a
message if user’s balance exceeds credit limit
Process next customer
Second refinement:
Prompt the user for the first customer’s account number
Input the first customer’s account number
While the sentinel value (-1) has not been entered for the account number
Prompt the user for the customer’s beginning balance
Input the customer’s beginning balance
Prompt the user for the customer’s total charges
Input the customer’s total charges
Prompt the user for the customer’s total credits
Input the customer’s total credits
Prompt the user for the customer’s credit limit
Input the customer’s credit limit
Calculate and display the customer’s new balance
If the balance exceeds the credit limit
Print the account number
Print the credit limit
Print the balance
Print “Credit Limit Exceeded”
Input the next customer’s account number
You might also like to view...
A control that has a text box and a list that is hidden until you click its arrow
a. Combo box b. Selection box c. Text box
Answer the following statements true (T) or false (F)
1) When processes cooperate by communication, the various processes participate in a common effort that links all of the processes. 2) Atomicity guarantees isolation from concurrent processes. 3) Concurrent processes do not come into conflict with each other when they are competing for the use of the same resource. 4) Two or more processes can cooperate by means of simple signals, such that a process can be forced to stop at a specified place until it has received a specific signal. 5) The functioning of a process, and the output it produces, must be independent of the speed at which its execution is carried out relative to the speed of other concurrent processes.