Question: C Programming For your lab, you will write a small utility to determine whether a store customer has exceeded the credit limit on their account.

C Programming

For your lab, you will write a small utility to determine whether a store customer has exceeded the credit limit on their account. To accomplish this, your program will accept as input five values, listed below:

  1. Account Number (an integer value)
  2. The customers balance at the beginning of the month
  3. The total of all items charged by the customer this month
  4. The total of all credits applied to this customers account
  5. Allowed credit limit

You will need to declare a variable to store each of the above values. The account number is an integer value, but I will leave it to you to determine what data type should be used for the other four (hint: they are all currency amounts, so should support decimal points).

Once you have prompted for and stored the users input into the associated variables, you will need to calculate the customers new balance. This is achieved through the formula (new balance = original balance + charges credits). You may want to declare a new variable to store this total.

Finally, using an if statement, determine if the users new balance has exceeded their credit limit. If it has (and only if it has), print out the users account number, credit limit, and new balance, so that the information may be reviewed. If the user has not exceeded their limit, print out their account number and a message informing the user that they are in good standing. For an idea of how you might format this output, see the sample screenshots below.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!