Summary 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 d2 is the number of days payment is made before billing cycle. Then, the average daily balance is: averageDailyBalance = (netBalance * d1 interest = averageDailyBalance * 0.0152 - the interest rate per month is, say, 0.0152, then the interest on the unpaid balance is: Instructions payme Write a program that accepts as input netBalance, d1, payment, d2, and interest rate per month ( interestRate).

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section: Chapter Questions
Problem 1PP: (Probability) The probability that a phone call will last less than t minutes can be pproximated by...
icon
Related questions
Question
100%

Terminal 1 Input: 100 30 50 7 9.7

Terminal 2 input: 255.6 31 55 3 12.3

Summary
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 d2 is the number of
days payment is made before billing cycle.
Then, the average daily balance is:
averageDailyBalance = (netBalance * d1 payme
If the interest rate per month is, say, 0.0152, then the
interest on the unpaid balance is:
interest averageDailyBalance * 0.0152
Instructions
Write a program that accepts as input netBalance,
d1, payment, d2, and interest rate per month (
interestRate).
Transcribed Image Text:Summary 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 d2 is the number of days payment is made before billing cycle. Then, the average daily balance is: averageDailyBalance = (netBalance * d1 payme If the interest rate per month is, say, 0.0152, then the interest on the unpaid balance is: interest averageDailyBalance * 0.0152 Instructions Write a program that accepts as input netBalance, d1, payment, d2, and interest rate per month ( interestRate).
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Everything in my terminal before "Enter net balance: 0.00" showed up on its own when I ran the program. I changed the formula to   averageDailyBalance = (netBalance * d1 - payment * d2)/d1; and something I still incorrect. I sent over what I have on each side if you could help look over this

8
!!!
3
</>
main.cpp
1 #include <iostream>
2 #include <iomanip>
3
4 using namespace std;
5
go
Ⓒ
6 int main() {
7
double netBalance, d1, payment, interest, d2, interestRate, average DailyBalance;
) 0 -
8
12
13
14
15
+
16
17
18
19
cout << setprecision (2) << fixed << showpoint;
cout << "Enter net balance: ";
cin >> netBalance;
cout << "Enter number of days in the billing cycle: ";
cin >> dl;
cout << "Enter payment made: ";
cin >> payment;
»
cout << "Enter number of days payment is made before billing cycle: ";
cin >> d2;
cout << "Enter the interest rate: ";
cin >> interest;
20
21
averageDailyBalance (netBalance * d1 payment * d2)/dl;
22 interest = averageDailyBalance * interestRate;
23
24
25 return 0;
26 }
cout<<endl<<"Interest is: "<< interest << endl;
O
hp
99+
a
(((
Transcribed Image Text:8 !!! 3 </> main.cpp 1 #include <iostream> 2 #include <iomanip> 3 4 using namespace std; 5 go Ⓒ 6 int main() { 7 double netBalance, d1, payment, interest, d2, interestRate, average DailyBalance; ) 0 - 8 12 13 14 15 + 16 17 18 19 cout << setprecision (2) << fixed << showpoint; cout << "Enter net balance: "; cin >> netBalance; cout << "Enter number of days in the billing cycle: "; cin >> dl; cout << "Enter payment made: "; cin >> payment; » cout << "Enter number of days payment is made before billing cycle: "; cin >> d2; cout << "Enter the interest rate: "; cin >> interest; 20 21 averageDailyBalance (netBalance * d1 payment * d2)/dl; 22 interest = averageDailyBalance * interestRate; 23 24 25 return 0; 26 } cout<<endl<<"Interest is: "<< interest << endl; O hp 99+ a (((
nterest, d2, interest Rate, averageDailyBa
ed << showpoint;
in the billing cycle: ";
te: ";
nce * d1 - payment * d2)/d1;
* interestRate;
interest << endl;
payment is made before billing cycle:illing cycle: 7
?
16
99+
a
> Terminal
)
sandbox $ rm -f a.out
sandbox $
sandbox $
sandbox $ g++ -Wall-std=c++0x main.cpp
main.cpp: In function 'int main()':
main.cpp:22:34: warning: interestRate' may b
e used uninitialized in this function [-Wmayb
e-uninitialized]
est = averageDailyBalance * interestRate;
NN
X
sandbox $ ./a.out
Enter net balance: 100
Enter number of days in the billing cycle: 30
Enter payment made: 50
Enter number of days payment is made before b
J
+
Enter the interest rate: 9.7
Interest is: 0.00
sandbox $
(())
A-Z
½
bongo
+
€3
7:13 PM
10/22/2022
quez
Transcribed Image Text:nterest, d2, interest Rate, averageDailyBa ed << showpoint; in the billing cycle: "; te: "; nce * d1 - payment * d2)/d1; * interestRate; interest << endl; payment is made before billing cycle:illing cycle: 7 ? 16 99+ a > Terminal ) sandbox $ rm -f a.out sandbox $ sandbox $ sandbox $ g++ -Wall-std=c++0x main.cpp main.cpp: In function 'int main()': main.cpp:22:34: warning: interestRate' may b e used uninitialized in this function [-Wmayb e-uninitialized] est = averageDailyBalance * interestRate; NN X sandbox $ ./a.out Enter net balance: 100 Enter number of days in the billing cycle: 30 Enter payment made: 50 Enter number of days payment is made before b J + Enter the interest rate: 9.7 Interest is: 0.00 sandbox $ (()) A-Z ½ bongo + €3 7:13 PM 10/22/2022 quez
Solution
Bartleby Expert
SEE SOLUTION
Follow-up Question

My interest results keeps coming out to 0.00? Not sure what I'm doing wrong

!!!
3
Lill
</
f
main.cpp
1 #include <iostream>
2 #include <iomanip>
3
4 using namespace std;
5
8
9
10
11
+
12
13
14
15
16
17
18
19
cout << setprecision (2) << fixed << showpoint;
cout << "Enter net balance: ";
cin >> netBalance;
cout << "Enter number of days in the billing cycle: ";
cin >> dl;
12
6 int main() {
р
7
double netBalance, d1, payment, interest, d2, interestRate, averageDailyBalance; main.cpp: In function 'int main()':
main.cpp:22:34: warning: 'interestRate
cout << "Enter payment made: ";
cin >> payment;
cout << "Enter number of days payment is made before billing cycle: ";
cin >> d2;
cout << "Enter the interest rate: ";
cin >> interest;
20
21 averageDailyBalance
22
23
24
25
26}
11
return 0;
(netBalance * d1 - payment * d2)/dl;
interest = averageDailyBalance * interestRate;
cout<<endl<<"Interest is: "<< interest << endl;
O
E
I
hp
99+
a
s
(l
> Terminal
sandbox $ rm -f a.out
X
sandbox $
sandbox $
sandbox $ g++ -Wall -std=c++0x main.cp
I
+
may be used uninitialized in this fu
nction [-Wmaybe-uninitialized]
eDailyBalance *interestRate;
NNN
sandbox $ ./a.out
Enter net balance: 100
Enter number of days in the billing cy
cle: 30
Enter payment made: 50
Enter number of days payment is made b
Interest is: 0.00
sandbox $
efore billing cycle: 7
Enter the interest rate: 9.7
Transcribed Image Text:!!! 3 Lill </ f main.cpp 1 #include <iostream> 2 #include <iomanip> 3 4 using namespace std; 5 8 9 10 11 + 12 13 14 15 16 17 18 19 cout << setprecision (2) << fixed << showpoint; cout << "Enter net balance: "; cin >> netBalance; cout << "Enter number of days in the billing cycle: "; cin >> dl; 12 6 int main() { р 7 double netBalance, d1, payment, interest, d2, interestRate, averageDailyBalance; main.cpp: In function 'int main()': main.cpp:22:34: warning: 'interestRate cout << "Enter payment made: "; cin >> payment; cout << "Enter number of days payment is made before billing cycle: "; cin >> d2; cout << "Enter the interest rate: "; cin >> interest; 20 21 averageDailyBalance 22 23 24 25 26} 11 return 0; (netBalance * d1 - payment * d2)/dl; interest = averageDailyBalance * interestRate; cout<<endl<<"Interest is: "<< interest << endl; O E I hp 99+ a s (l > Terminal sandbox $ rm -f a.out X sandbox $ sandbox $ sandbox $ g++ -Wall -std=c++0x main.cp I + may be used uninitialized in this fu nction [-Wmaybe-uninitialized] eDailyBalance *interestRate; NNN sandbox $ ./a.out Enter net balance: 100 Enter number of days in the billing cy cle: 30 Enter payment made: 50 Enter number of days payment is made b Interest is: 0.00 sandbox $ efore billing cycle: 7 Enter the interest rate: 9.7
Solution
Bartleby Expert
SEE SOLUTION
Follow-up Question

My interest keeps coming out to 0.00. Not sure what I keep doing wrong

8
!!!
</>
main.cpp
go
1 #include <iostream>
2 #include <iomanip>
3
4 using namespace std;
5
Ⓒ
6 int main() {
7
double netBalance, d1, payment, interest, d2, interest Rate, average DailyBalance
8
10
11
O
9
+
12
13
14
15
16
17
18
cout << setprecision(2) << fixed << showpoint;
cout << "Enter net balance:
cin >> netBalance;
cout << "Enter number of days in the billing cycle: ";
cin >> dl;
cout << "Enter payment made:
cin >> payment;
cout << "Enter number of days payment is made before billing cycle: ";
cin >> d2;
cout << "Enter the interest rate: ";
cin >> interest;
20
21 averageDailyBalance = (netBalance * d1* d2 - payment)/dl;
22 interest = averageDailyBalance * interestRate;
23
24
25 return 0;
26}
cout<<endl<<"Interest is: "<< interest << endl;
0
--
hp
99+
a
0
(
>_ Terminal
sandbox $ rm -f a.out
р
X +
sandbox $
sandbox $
sandbox $ g++ -Wall -std=c++0x main.cp
main.cpp: In function 'int main()':
main.cpp:22:34: warning: 'interestRate
may be used uninitialized in this fu
nction [-Wmaybe-uninitialized]
eDailyBalance * interestRate;
sandbox $ ./a.out
Enter net balance: 100
Enter number of days in the billing cy
cle: 30
Enter payment made: 50
Enter number of days payment is made b
efore billing cycle: 7
Enter the interest rate: 9.7
Interest is: 0.00
sandbox $
X
bonc
6:54 P
10/22/202
Transcribed Image Text:8 !!! </> main.cpp go 1 #include <iostream> 2 #include <iomanip> 3 4 using namespace std; 5 Ⓒ 6 int main() { 7 double netBalance, d1, payment, interest, d2, interest Rate, average DailyBalance 8 10 11 O 9 + 12 13 14 15 16 17 18 cout << setprecision(2) << fixed << showpoint; cout << "Enter net balance: cin >> netBalance; cout << "Enter number of days in the billing cycle: "; cin >> dl; cout << "Enter payment made: cin >> payment; cout << "Enter number of days payment is made before billing cycle: "; cin >> d2; cout << "Enter the interest rate: "; cin >> interest; 20 21 averageDailyBalance = (netBalance * d1* d2 - payment)/dl; 22 interest = averageDailyBalance * interestRate; 23 24 25 return 0; 26} cout<<endl<<"Interest is: "<< interest << endl; 0 -- hp 99+ a 0 ( >_ Terminal sandbox $ rm -f a.out р X + sandbox $ sandbox $ sandbox $ g++ -Wall -std=c++0x main.cp main.cpp: In function 'int main()': main.cpp:22:34: warning: 'interestRate may be used uninitialized in this fu nction [-Wmaybe-uninitialized] eDailyBalance * interestRate; sandbox $ ./a.out Enter net balance: 100 Enter number of days in the billing cy cle: 30 Enter payment made: 50 Enter number of days payment is made b efore billing cycle: 7 Enter the interest rate: 9.7 Interest is: 0.00 sandbox $ X bonc 6:54 P 10/22/202
Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Problems on Dynamic Programming
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning