Answer to Question #224784 in C for MENSAH PAUL OSEI

Question #224784
Interest on a credit card's unpaid balance is calculated using the average daily balance. Suppose that netBalance is the balance shown in the bill, payment is the payment made, d1 is the number of days in the billing cycle, and 2 is the number of days payment is made before billing cycle. Then, the average daily balance isc

average Daily Balance (net Balance" di-payment d2)/d1

If the interest rate per month is, say, 0.0152, then the interest on the unpaid balance is

interest average DailyBalance 0.0152

Write a program that accepts as input netBalance, payment, d1, 2, and interest rate per month. The program outputs the interest. Format your output to two decimal places.
1
Expert's answer
2021-08-10T04:28:37-0400


#include <stdio.h>






int main()
{
    float netBalance,d1,payment,interest,d2,monthlyInterestRate,averageDailyBalance;


    printf("Enter net Balance: \n");
   scanf("%f",&netBalance);
   
    printf("Enter payment made: \n");
    scanf("%f",&payment);
    printf("Enter number of days in the billing cycle: \n");
    scanf("%f",&d1);
    printf("Enter number of days payment is made before billing cycle: \n");
    scanf("%f",&d2);
   printf("Enter interest per month: \n");
 	scanf("%f",&monthlyInterestRate);




    averageDailyBalance = (netBalance * d1 - payment * d2)/d1;
    interest = averageDailyBalance * monthlyInterestRate;
	printf("Interest is %0.2f",interest);
   
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS