int main() { CDAC count account; cout <« "Enter account balance: PhP "; cin » 2_.balance; cout <« "Enter account interest: "; cin >> cout << "Enter the number of months until maturity: "; cin >> _?__.term; 2_.interestRate;

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Complete the following code and then generate an equivalent code in python.

(CDAccount& _account)
{
double rateFraction, interest;
rateFraction = _account.interestRate/100.0;
interest = _account.balance* (rateFraction*_account.term/12.0));
_account.balance - _account.balance + interest;
}
CDAC count
(CDAccount oldAccount)
CDAccount temp;
temp = oldAccount;
temp.interestRate - 2*oldAccount.interestRate;
return temp;
}
Output:
Enter account balance: PhP 10000
Enter account interest: 10
Enter the nunber of nonths until maturity: 12
Old Account
When your CD natures in
12 nonths,
it will have a balance of PHP11000
New Account
When your CD natures in 12_months,
it will have a balance of PhP13200
Transcribed Image Text:(CDAccount& _account) { double rateFraction, interest; rateFraction = _account.interestRate/100.0; interest = _account.balance* (rateFraction*_account.term/12.0)); _account.balance - _account.balance + interest; } CDAC count (CDAccount oldAccount) CDAccount temp; temp = oldAccount; temp.interestRate - 2*oldAccount.interestRate; return temp; } Output: Enter account balance: PhP 10000 Enter account interest: 10 Enter the nunber of nonths until maturity: 12 Old Account When your CD natures in 12 nonths, it will have a balance of PHP11000 New Account When your CD natures in 12_months, it will have a balance of PhP13200
using namespace std;
//Certificate of Deposit Account Structure
struct CDAccount{
double balance;
double interestRate;
int term;
};
CDAccount doubleInterest(CDAccount oldAccount);
void accountBalance(CDAccount& _account);
int main()
{
CDAccount account;
cout <« "Enter account balance: PhP ";
cin » _ _.balance;
cout <« "Enter account interest: ";
cin >>
cout <« "Enter the number of months until maturity: ";
cin » _2_.term;
_.interestRate;
accountBalance (account);
cout <« "\nold Account \n"
<« "When your CD matures in \n"
2_.term <« " months, \n"
<« "it will have a balance of PhP"
2_. balance <« endl;
<<
<<
CDAC count accountNew;
accountNew = doubleInterest(account);
accountBalance(accountNew);
cout <« "\nNew Account \n"
<« "When your CD matures in "
« accountNew.term << " months,\n"
<« "it will have a balance of PhP"
« accountNew.balance << endl;
system ("pause>0");
return 0;
Transcribed Image Text:using namespace std; //Certificate of Deposit Account Structure struct CDAccount{ double balance; double interestRate; int term; }; CDAccount doubleInterest(CDAccount oldAccount); void accountBalance(CDAccount& _account); int main() { CDAccount account; cout <« "Enter account balance: PhP "; cin » _ _.balance; cout <« "Enter account interest: "; cin >> cout <« "Enter the number of months until maturity: "; cin » _2_.term; _.interestRate; accountBalance (account); cout <« "\nold Account \n" <« "When your CD matures in \n" 2_.term <« " months, \n" <« "it will have a balance of PhP" 2_. balance <« endl; << << CDAC count accountNew; accountNew = doubleInterest(account); accountBalance(accountNew); cout <« "\nNew Account \n" <« "When your CD matures in " « accountNew.term << " months,\n" <« "it will have a balance of PhP" « accountNew.balance << endl; system ("pause>0"); return 0;
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY