1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
notsponge [240]
3 years ago
13

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 are available: 1. Account number (integer) 2. Balance at the beginning at the month 3. Total of all items charged by this customer this month 4. Total of all credits applied to this customer’s account this month 5. Allowed credit limit The program should use a while statement to input each of these facts, calculate the new balance (=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"
Computers and Technology
1 answer:
harina [27]3 years ago
3 0

Answer:

#include <iostream> // For including input output functions

using namespace std; // used by computer to identify cout cin endl

int main() { start of the body of main function

 int Account_Number; // stores the account number

double starting_balance; //stores beginning balance

double total_charges; // stores all items charged

double total_credit; // stores total credits applied to customers account

double credit_limit; // stores allowed credit limit

double new_balance; //stores the  new balance

while( Account_Number != -1 ) // loop continues until acc no is -1

{    cout<<"Please Enter The Account Number " ;

//prompts the user to enter the account number

  cin>>Account_Number; // reads account number

   cout<< "Please Enter Beginning Balance: " ;

   cin>>starting_balance ; //reads beginning balance

   cout<< "Please Enter the Total Charges: " ;

   cin>>total_charges; //reads total charges

  cout<< "Please Enter Total Credits: " ;

   cin>>total_credit; // reads total credits

   cout<< "Please Enter Credit Limit: " ;

   cin>>credit_limit ; //reads credit limit

// calculates the new balance

   new_balance = starting_balance + total_charges - total_credit;

// checks if the new balance exceeds customers credit limit

   if ( new_balance > credit_limit ) {

/* if the credit limit is exceeded, the program displays the customer’s account number, credit limit, new balance and the message "Credit Limit Exceeded */

    cout<< "Account Number:"<<Account_Number<<endl;

     cout<< "Credit Limit:"<< credit_limit<<endl;

    cout<< "New Balance:"<<new_balance<<endl;

     cout<< "Credit Limit Exceeded."<<endl ;    }

   cout << "Please Enter Account Number (-1 to end): "<<endl;

 cin >> Account_Number;}  }  

Explanation:

This program calculates the new balance by adding beginning balance and total charges and subtracting total credits applied to the customer from starting balance and total charges. If statement is used here to check the condition if the new balance exceeded the credit limit. If this is true then the program displays customer’s account number, credit limit, new balance and the message "Credit Limit Exceeded. While loop here will continue to execute until the user enters -1.

You might be interested in
Give me 3 facts and 3 opinions
zzz [600]

Hello!

I assume you mean 3 facts about computer/technology based things.

Fact: Certain computers are built for video games, where others are not.

Opinion: All computers suck when trying to use video games.

Fact: Not all computers are made for multiple purposes.

Opinion: All good computers are made by apple.

Fact: You can plug in certain things such as keyboards or a mouse, but not all computers have this.

Opinion: Only good computers have built in keyboards and a mouse.

3 0
3 years ago
Which statement best describes the cut and paste option in a word processor?
tekilochka [14]

B i correct so yea and yea

8 0
3 years ago
Read 2 more answers
The process of learning by making mistakes and by trial and error is called _____.
vodomira [7]
I believe it’s problem solving.
6 0
3 years ago
What is the difference between posting and transfer in ICT please I need the answer before TMR​
Radda [10]

Answer: b

Explanation: trust

7 0
2 years ago
A computer reads a sequence from top to bottom and left to right? True or False
Nat2105 [25]
The answer is False
5 0
3 years ago
Other questions:
  • True False The explicit location always tells you where users are located when they type the query.
    10·2 answers
  • Which type of communication is usually handwriten
    11·2 answers
  • Write the definitions of two classes Day and Night. Both classes have no constructors, methods or instance variables. Note: For
    8·1 answer
  • Write a function shampoo_instructions() with parameter num_cycles. If num_cycles is less than 1, print "Too few.". If more than
    7·1 answer
  • Which type of account is typically the MOST liquid?
    15·1 answer
  • A computer consists of both software and hardware. a)Define the term software​
    5·1 answer
  • A program that allows employees to choose their starting and ending times, as long as they are at work during a specified core p
    8·1 answer
  • Name any four areas where computers are used​
    15·1 answer
  • What is pollution?
    14·2 answers
  • QUICK HELP ME PLEASE
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!