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).
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).
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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).](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F50f86a9a-dfbf-48fb-a8b1-f37eac08df1e%2Fb58f6f79-29a8-4538-969b-fcd2a482cab9%2Fsvcvuxq_processed.jpeg&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
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
![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
(((](https://content.bartleby.com/qna-images/question/50f86a9a-dfbf-48fb-a8b1-f37eac08df1e/663212c4-e13d-4e1e-abe2-93c8c1c0bb3a/xw1g0d_thumbnail.jpeg)
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](https://content.bartleby.com/qna-images/question/50f86a9a-dfbf-48fb-a8b1-f37eac08df1e/663212c4-e13d-4e1e-abe2-93c8c1c0bb3a/urje3lf6_thumbnail.jpeg)
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
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](https://content.bartleby.com/qna-images/question/50f86a9a-dfbf-48fb-a8b1-f37eac08df1e/7c6751e2-b82b-4bd5-859d-f95a12308f01/4vxmnxj_thumbnail.jpeg)
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
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](https://content.bartleby.com/qna-images/question/50f86a9a-dfbf-48fb-a8b1-f37eac08df1e/229ad84e-de1a-45d3-9d6e-cfbc44f90735/2sguu0n_thumbnail.jpeg)
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
Knowledge Booster
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.Recommended textbooks for you
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education