what is the pseudocode that will prepare the monthly credit card billing report of a customer. The input will contain the name of the person who has purchased on credit, the previous balance, total purchases and total payments. The output lists the name, interest and new balance.
The amount subject to a finance charge is obtained by adding the total purchases to the previous balance and subtracting the total payments. If the amount subject to a finance charge is $250 or more, interest will be calculated by multiplying this amount by 1.5 percent. Otherwise the interest is calculated as 1 percent of the amount. The new balance is obtained by adding the interest to the amount subject to a finance charge.
def Billing(name: str,Previous_balance: int,allsumbuy: int, fullpayment:int):
Amountpaid = allsumbuy + Previous_balance - fullpayment
if Amountpaid >= 250:
return name ,Amountpaid * 1,5 / 100, Previous_balance + Amountpaid * 1,5 / 100
else:
return name , Amountpaid * 1 /100 , Previous_balance + Amountpaid * 1 / 100
print(Billing('Billy',100,120,145))
Comments
Leave a comment