Last active
September 4, 2023 14:48
-
-
Save eru123/d70d8d4a5b5b1ac157b0569eca0a1e01 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
double interestRate = 0.0152; | |
double netBalance = 0, payment = 0, interest = 0, | |
d1 = 0, d2 = 0, averageDailyBalance = 0; | |
cout << "*************************************" << endl; | |
cout << "* Name: Vanessa Mae Abare *" << endl; | |
cout << "* Section: BSCPE 1A *" << endl; | |
cout << "* Machine Exercise #2: INPUT/OUTPUT *" << endl; | |
cout << "*************************************" << endl; | |
cout << "Enter the net balance: "; | |
cin >> netBalance; | |
cout << "Enter the payment made: "; | |
cin >> payment; | |
cout << "Enter the number of days in the billing cycle: "; | |
cin >> d1; | |
cout << "Enter the number of days payment is made before billing cycle: "; | |
cin >> d2; | |
averageDailyBalance = (netBalance * d1 - payment * d2) / d1; | |
interest = averageDailyBalance * interestRate; | |
cout << "The interest is: " << interest << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment