In: Computer Science
Develop a python program that will determine if a department store customer has exceeded the credit limit on a charge account. For each customer, the following facts are available:
Account number Balance at the beginning of the month Total of all items charged by this customer this month Total of all credits applied to this customer’s account this month Allowed credit limit
The program should input each of the facts, calculate the new balance (=beginning balance + charges – credits), and determine if the new balance exceeds the customer’s credit limit. For those customers who credit limit is exceeded, the program should display the customer’s account number, credit limit, new balance and the message “Credit limit exceeded”.
Answer: hi! Find your solution here. This program will input takes for account number, balance begining of the month, charges of the month, credits applied on this month and credit limit then calculate new balance. If new balance is greater than credit limit then dispaly all information of the account holder. If you have any query , feel free to ask me. Thanks.
#takes input form user for account number
account_number = int(input("enter account number: "))
#takes input begining balance
bal_begining_of_month = float(input("Enter balance begining of the
month: "))
#total charges will takes input
charged_items = int(input("Enter Total of all items charged by this
customer this month: "))
#total credits input from user
credit = float(input("Total credit applied of this month: "))
#takes input for credit card limit
credit_limit = float(input("Enter credit card limit: "))
#calculate new balance
new_balance = bal_begining_of_month + charged_items
new_balance = new_balance - credit
if new_balance>credit_limit: #check whether new balance is
greater than limit then print all information
print("Account number: ",account_number)
print("Credit Limit: ",credit_limit)
print("New Balance: ",new_balance)
print("Credit card limit exceeded")
#if false condtion then print new balance
else:
print("New Balance: ",new_balance)