SlideShare a Scribd company logo
1 of 5
Download to read offline
Can you fix the problem with the following code
#include <iostream>
#include <iomanip>
using namespace std;
class bankAccount
{public:
bankAccount(int,double);
void setAccNum(int);
int getAccNum();
double getBalance();
void withdraw(double);
void deposit(double);
void print();
protected:
int accNum;
double balance;
};
class savingsAccount: public bankAccount
{public:
savingsAccount(int,double);
void setRate(double);
double getRate();
void withdraw(double);
void postInterest();
void savingsAccount::print();
protected:
double rate;
};
class checkingAccount: public bankAccount
{
public:
checkingAccount(int accNum,double bal);
double getMinBal();
double getRate();
double getFee();
void setMinBal(double);
void setRate(double);
void setFee(double);
void postInterest();
bool checkMinBal(double);
void checkingAccount::writeCheck(double);
void withdraw(double);
void print();
protected:
double rate,minBal,fee;
};
bankAccount::bankAccount(int n,double b)
{accNum=n;
balance=b;
}
void bankAccount::setAccNum(int a)
{accNum=a;
}
int bankAccount::getAccNum()
{return accNum;
}
double bankAccount::getBalance()
{return balance;
}
void bankAccount::withdraw(double a)
{balance-=a;
}
void bankAccount::deposit(double a)
{balance+=a;
}
void bankAccount::print()
{cout<<accNum<<"Balance: $"<<setprecision(2)<<fixed<<balance<<endl;
}
checkingAccount::checkingAccount(int n,double b):bankAccount(n,b)
{setRate(.04);
setMinBal(500);
setFee(20);
}
double checkingAccount::getMinBal()
{return minBal;
}
double checkingAccount::getRate()
{return rate;
}
double checkingAccount::getFee()
{return fee;
}
void checkingAccount::setMinBal(double m)
{minBal=m;
}
void checkingAccount::setRate(double r)
{rate=r;
}
void checkingAccount::setFee(double f)
{fee=f;
}
void checkingAccount::postInterest()
{balance+=(balance*rate);
}
bool checkingAccount::checkMinBal(double a)
{if(balance-a>=minBal)
return true;
else
return false;
}
void checkingAccount::writeCheck(double a)
{withdraw(a);
}
void checkingAccount::withdraw(double a)
{if(balance-a<0)
cout<<"insufficient funds for $"<<a<<" withdrawaln";
else if(balance-a<minBal)
if(balance-a-fee<minBal)
cout<<"insufficient funds for withdrawal + fees, since balance will be below minimumn";
else
{cout<<"balance below minimum. $"<<fee<<" fee chargedn";
balance-=(a+fee);
}
else
balance-=a;
}
void checkingAccount::print()
{cout<<"Interest Checking ACCT#:t"<<getAccNum()
<<"tBalance: $"<<setprecision(2)<<fixed<<getBalance()<<endl;
}
savingsAccount::savingsAccount(int n,double b):bankAccount(n,b)
{setRate(.06);
}
double savingsAccount::getRate()
{return rate;
}
void savingsAccount::setRate(double r)
{rate=r;
}
void savingsAccount::withdraw(double a)
{if(balance-a<0)
cout<<"insufficient funds for $"<<setprecision(2)<<fixed<<" withdrawaln";
else
balance-=a;
}
void savingsAccount::postInterest()
{balance+=(balance*rate);
}
void savingsAccount::print()
{cout<<"Savings ACCT#:ttt"<<getAccNum()
<<"tBalance: $"<<setprecision(2)<<fixed<<getBalance()<<endl;
}
int main()
{
checkingAccount a(1234,1000);
checkingAccount b(5678, 450);
savingsAccount c(91011, 9300);
savingsAccount d(121314, 32);
a.deposit(1000);
b.deposit(2300);
c.deposit(800);
d.deposit(500);
a.postInterest();
b.postInterest();
c.postInterest();
d.postInterest();
a.print();
b.print();
c.print();
d.print();
a.writeCheck(250);
b.writeCheck(350);
c.withdraw(120);
d.withdraw(290);
a.print();
b.print();
c.print();
d.print();
system("pause");
return 0;
}
Can you fix the problem with the following code  #include -iostream- #.pdf

More Related Content

Similar to Can you fix the problem with the following code #include -iostream- #.pdf

Consider this C++ BankAccount class with the following public member.pdf
Consider this C++ BankAccount class with the following public member.pdfConsider this C++ BankAccount class with the following public member.pdf
Consider this C++ BankAccount class with the following public member.pdfarchigallery1298
 
Binary addition using class concept in c++
Binary addition using class concept in c++Binary addition using class concept in c++
Binary addition using class concept in c++Swarup Boro
 
Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#Juan Pablo
 
import java.util.Scanner;import java.text.DecimalFormat;import j.pdf
import java.util.Scanner;import java.text.DecimalFormat;import j.pdfimport java.util.Scanner;import java.text.DecimalFormat;import j.pdf
import java.util.Scanner;import java.text.DecimalFormat;import j.pdfKUNALHARCHANDANI1
 
Please distinguish between the .h and .cpp file, create a fully work.pdf
Please distinguish between the .h and .cpp file, create a fully work.pdfPlease distinguish between the .h and .cpp file, create a fully work.pdf
Please distinguish between the .h and .cpp file, create a fully work.pdfneerajsachdeva33
 
Applying Compiler Techniques to Iterate At Blazing Speed
Applying Compiler Techniques to Iterate At Blazing SpeedApplying Compiler Techniques to Iterate At Blazing Speed
Applying Compiler Techniques to Iterate At Blazing SpeedPascal-Louis Perez
 
Hi,I have updated the code as per your requirement. Highlighted th.pdf
Hi,I have updated the code as per your requirement. Highlighted th.pdfHi,I have updated the code as per your requirement. Highlighted th.pdf
Hi,I have updated the code as per your requirement. Highlighted th.pdfannaindustries
 
The java class Account that simultes the Account class.pdf
   The java class Account that simultes  the Account class.pdf   The java class Account that simultes  the Account class.pdf
The java class Account that simultes the Account class.pdfakshay1213
 
This what Im suppose to do and this is what I have so far.In thi.pdf
This what Im suppose to do and this is what I have so far.In thi.pdfThis what Im suppose to do and this is what I have so far.In thi.pdf
This what Im suppose to do and this is what I have so far.In thi.pdfkavithaarp
 
C# Programming. Using methods to call results to display. The code i.pdf
C# Programming. Using methods to call results to display. The code i.pdfC# Programming. Using methods to call results to display. The code i.pdf
C# Programming. Using methods to call results to display. The code i.pdffatoryoutlets
 
Account.h Definition of Account class. #ifndef ACCOUNT_H #d.pdf
Account.h  Definition of Account class. #ifndef ACCOUNT_H #d.pdfAccount.h  Definition of Account class. #ifndef ACCOUNT_H #d.pdf
Account.h Definition of Account class. #ifndef ACCOUNT_H #d.pdfanujmkt
 
Banks offer various types of accounts, such as savings, checking, cer.pdf
Banks offer various types of accounts, such as savings, checking, cer.pdfBanks offer various types of accounts, such as savings, checking, cer.pdf
Banks offer various types of accounts, such as savings, checking, cer.pdfrajeshjain2109
 
public class InsufficientFundsException extends Exception{Insuffic.pdf
public class InsufficientFundsException extends Exception{Insuffic.pdfpublic class InsufficientFundsException extends Exception{Insuffic.pdf
public class InsufficientFundsException extends Exception{Insuffic.pdfankitcom
 
IP project for class 12 cbse
IP project for class 12 cbseIP project for class 12 cbse
IP project for class 12 cbsesiddharthjha34
 
public class NegativeAmountException extends Exception {    .pdf
public class NegativeAmountException extends Exception {     .pdfpublic class NegativeAmountException extends Exception {     .pdf
public class NegativeAmountException extends Exception {    .pdfARYAN20071
 

Similar to Can you fix the problem with the following code #include -iostream- #.pdf (19)

Consider this C++ BankAccount class with the following public member.pdf
Consider this C++ BankAccount class with the following public member.pdfConsider this C++ BankAccount class with the following public member.pdf
Consider this C++ BankAccount class with the following public member.pdf
 
Binary addition using class concept in c++
Binary addition using class concept in c++Binary addition using class concept in c++
Binary addition using class concept in c++
 
Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#
 
import java.util.Scanner;import java.text.DecimalFormat;import j.pdf
import java.util.Scanner;import java.text.DecimalFormat;import j.pdfimport java.util.Scanner;import java.text.DecimalFormat;import j.pdf
import java.util.Scanner;import java.text.DecimalFormat;import j.pdf
 
Please distinguish between the .h and .cpp file, create a fully work.pdf
Please distinguish between the .h and .cpp file, create a fully work.pdfPlease distinguish between the .h and .cpp file, create a fully work.pdf
Please distinguish between the .h and .cpp file, create a fully work.pdf
 
Applying Compiler Techniques to Iterate At Blazing Speed
Applying Compiler Techniques to Iterate At Blazing SpeedApplying Compiler Techniques to Iterate At Blazing Speed
Applying Compiler Techniques to Iterate At Blazing Speed
 
Hi,I have updated the code as per your requirement. Highlighted th.pdf
Hi,I have updated the code as per your requirement. Highlighted th.pdfHi,I have updated the code as per your requirement. Highlighted th.pdf
Hi,I have updated the code as per your requirement. Highlighted th.pdf
 
The java class Account that simultes the Account class.pdf
   The java class Account that simultes  the Account class.pdf   The java class Account that simultes  the Account class.pdf
The java class Account that simultes the Account class.pdf
 
This what Im suppose to do and this is what I have so far.In thi.pdf
This what Im suppose to do and this is what I have so far.In thi.pdfThis what Im suppose to do and this is what I have so far.In thi.pdf
This what Im suppose to do and this is what I have so far.In thi.pdf
 
C# Programming. Using methods to call results to display. The code i.pdf
C# Programming. Using methods to call results to display. The code i.pdfC# Programming. Using methods to call results to display. The code i.pdf
C# Programming. Using methods to call results to display. The code i.pdf
 
Account.h Definition of Account class. #ifndef ACCOUNT_H #d.pdf
Account.h  Definition of Account class. #ifndef ACCOUNT_H #d.pdfAccount.h  Definition of Account class. #ifndef ACCOUNT_H #d.pdf
Account.h Definition of Account class. #ifndef ACCOUNT_H #d.pdf
 
Banks offer various types of accounts, such as savings, checking, cer.pdf
Banks offer various types of accounts, such as savings, checking, cer.pdfBanks offer various types of accounts, such as savings, checking, cer.pdf
Banks offer various types of accounts, such as savings, checking, cer.pdf
 
Generic programming
Generic programmingGeneric programming
Generic programming
 
public class InsufficientFundsException extends Exception{Insuffic.pdf
public class InsufficientFundsException extends Exception{Insuffic.pdfpublic class InsufficientFundsException extends Exception{Insuffic.pdf
public class InsufficientFundsException extends Exception{Insuffic.pdf
 
IP project for class 12 cbse
IP project for class 12 cbseIP project for class 12 cbse
IP project for class 12 cbse
 
public class NegativeAmountException extends Exception {    .pdf
public class NegativeAmountException extends Exception {     .pdfpublic class NegativeAmountException extends Exception {     .pdf
public class NegativeAmountException extends Exception {    .pdf
 
Statistics.hpp
Statistics.hppStatistics.hpp
Statistics.hpp
 
Class 6 2ciclo
Class 6 2cicloClass 6 2ciclo
Class 6 2ciclo
 
5 Rmi Print
5  Rmi Print5  Rmi Print
5 Rmi Print
 

More from vinaythemodel

c) Consider the case where a sender S continuously sends frames to a r.pdf
c) Consider the case where a sender S continuously sends frames to a r.pdfc) Consider the case where a sender S continuously sends frames to a r.pdf
c) Consider the case where a sender S continuously sends frames to a r.pdfvinaythemodel
 
Carolyn is a server at an Olive Garden restaurant and enjoys meeting n.pdf
Carolyn is a server at an Olive Garden restaurant and enjoys meeting n.pdfCarolyn is a server at an Olive Garden restaurant and enjoys meeting n.pdf
Carolyn is a server at an Olive Garden restaurant and enjoys meeting n.pdfvinaythemodel
 
Capillary exchange- Describe how materials move out of and into capill.pdf
Capillary exchange- Describe how materials move out of and into capill.pdfCapillary exchange- Describe how materials move out of and into capill.pdf
Capillary exchange- Describe how materials move out of and into capill.pdfvinaythemodel
 
Capillary exchange- Describe how materials move out of and into capill (1).pdf
Capillary exchange- Describe how materials move out of and into capill (1).pdfCapillary exchange- Describe how materials move out of and into capill (1).pdf
Capillary exchange- Describe how materials move out of and into capill (1).pdfvinaythemodel
 
Can you please show the truth table as well There are three inputs r-s.pdf
Can you please show the truth table as well There are three inputs r-s.pdfCan you please show the truth table as well There are three inputs r-s.pdf
Can you please show the truth table as well There are three inputs r-s.pdfvinaythemodel
 
Can you find the mutation (difference) between the two sequences- High.pdf
Can you find the mutation (difference) between the two sequences- High.pdfCan you find the mutation (difference) between the two sequences- High.pdf
Can you find the mutation (difference) between the two sequences- High.pdfvinaythemodel
 
Can you answer questions 30- 31 and 32 30- anterferons b- Respond be.pdf
Can you answer questions 30- 31 and 32   30- anterferons b- Respond be.pdfCan you answer questions 30- 31 and 32   30- anterferons b- Respond be.pdf
Can you answer questions 30- 31 and 32 30- anterferons b- Respond be.pdfvinaythemodel
 
Can someone please answer this question -2 Eligibility Requirements- Y.pdf
Can someone please answer this question -2 Eligibility Requirements- Y.pdfCan someone please answer this question -2 Eligibility Requirements- Y.pdf
Can someone please answer this question -2 Eligibility Requirements- Y.pdfvinaythemodel
 
Can somebody solve the TODO parts of the following problem- Thanks D.pdf
Can somebody solve the TODO parts of the following problem- Thanks   D.pdfCan somebody solve the TODO parts of the following problem- Thanks   D.pdf
Can somebody solve the TODO parts of the following problem- Thanks D.pdfvinaythemodel
 
can someone fix the errors in this code- the name needs to be Fraction.pdf
can someone fix the errors in this code- the name needs to be Fraction.pdfcan someone fix the errors in this code- the name needs to be Fraction.pdf
can someone fix the errors in this code- the name needs to be Fraction.pdfvinaythemodel
 
Can a student attending an American university raise First Amendment o.pdf
Can a student attending an American university raise First Amendment o.pdfCan a student attending an American university raise First Amendment o.pdf
Can a student attending an American university raise First Amendment o.pdfvinaythemodel
 
can a groundwater sample with a low redox potential could indicate a-.pdf
can a groundwater sample with a low redox potential could indicate a-.pdfcan a groundwater sample with a low redox potential could indicate a-.pdf
can a groundwater sample with a low redox potential could indicate a-.pdfvinaythemodel
 
Calculate FIS-FST- and FIT for the population with genotype frequencie.pdf
Calculate FIS-FST- and FIT for the population with genotype frequencie.pdfCalculate FIS-FST- and FIT for the population with genotype frequencie.pdf
Calculate FIS-FST- and FIT for the population with genotype frequencie.pdfvinaythemodel
 
C language Make a program to get utime and stime From -proc-pid-stat-.pdf
C language Make a program to get utime and stime  From -proc-pid-stat-.pdfC language Make a program to get utime and stime  From -proc-pid-stat-.pdf
C language Make a program to get utime and stime From -proc-pid-stat-.pdfvinaythemodel
 
Calculate the Current Ratios- (Please show the formula) CompanyCurre.pdf
Calculate the Current Ratios- (Please show the formula)   CompanyCurre.pdfCalculate the Current Ratios- (Please show the formula)   CompanyCurre.pdf
Calculate the Current Ratios- (Please show the formula) CompanyCurre.pdfvinaythemodel
 
Calculate the amount of money Sean had to deposit in an investment fun.pdf
Calculate the amount of money Sean had to deposit in an investment fun.pdfCalculate the amount of money Sean had to deposit in an investment fun.pdf
Calculate the amount of money Sean had to deposit in an investment fun.pdfvinaythemodel
 
Calculate FST for the random-mating subpopulations below based on the.pdf
Calculate FST for the random-mating subpopulations below based on the.pdfCalculate FST for the random-mating subpopulations below based on the.pdf
Calculate FST for the random-mating subpopulations below based on the.pdfvinaythemodel
 
CALCIUM PATHWAY trace a calcium ion from the small intestine to the in.pdf
CALCIUM PATHWAY trace a calcium ion from the small intestine to the in.pdfCALCIUM PATHWAY trace a calcium ion from the small intestine to the in.pdf
CALCIUM PATHWAY trace a calcium ion from the small intestine to the in.pdfvinaythemodel
 
Cadux Candy Company's income statement for the year ended December 31-.pdf
Cadux Candy Company's income statement for the year ended December 31-.pdfCadux Candy Company's income statement for the year ended December 31-.pdf
Cadux Candy Company's income statement for the year ended December 31-.pdfvinaythemodel
 
Calcium - Selonosis- characterized by hair loss- weile blotchy mail- g.pdf
Calcium - Selonosis- characterized by hair loss- weile blotchy mail- g.pdfCalcium - Selonosis- characterized by hair loss- weile blotchy mail- g.pdf
Calcium - Selonosis- characterized by hair loss- weile blotchy mail- g.pdfvinaythemodel
 

More from vinaythemodel (20)

c) Consider the case where a sender S continuously sends frames to a r.pdf
c) Consider the case where a sender S continuously sends frames to a r.pdfc) Consider the case where a sender S continuously sends frames to a r.pdf
c) Consider the case where a sender S continuously sends frames to a r.pdf
 
Carolyn is a server at an Olive Garden restaurant and enjoys meeting n.pdf
Carolyn is a server at an Olive Garden restaurant and enjoys meeting n.pdfCarolyn is a server at an Olive Garden restaurant and enjoys meeting n.pdf
Carolyn is a server at an Olive Garden restaurant and enjoys meeting n.pdf
 
Capillary exchange- Describe how materials move out of and into capill.pdf
Capillary exchange- Describe how materials move out of and into capill.pdfCapillary exchange- Describe how materials move out of and into capill.pdf
Capillary exchange- Describe how materials move out of and into capill.pdf
 
Capillary exchange- Describe how materials move out of and into capill (1).pdf
Capillary exchange- Describe how materials move out of and into capill (1).pdfCapillary exchange- Describe how materials move out of and into capill (1).pdf
Capillary exchange- Describe how materials move out of and into capill (1).pdf
 
Can you please show the truth table as well There are three inputs r-s.pdf
Can you please show the truth table as well There are three inputs r-s.pdfCan you please show the truth table as well There are three inputs r-s.pdf
Can you please show the truth table as well There are three inputs r-s.pdf
 
Can you find the mutation (difference) between the two sequences- High.pdf
Can you find the mutation (difference) between the two sequences- High.pdfCan you find the mutation (difference) between the two sequences- High.pdf
Can you find the mutation (difference) between the two sequences- High.pdf
 
Can you answer questions 30- 31 and 32 30- anterferons b- Respond be.pdf
Can you answer questions 30- 31 and 32   30- anterferons b- Respond be.pdfCan you answer questions 30- 31 and 32   30- anterferons b- Respond be.pdf
Can you answer questions 30- 31 and 32 30- anterferons b- Respond be.pdf
 
Can someone please answer this question -2 Eligibility Requirements- Y.pdf
Can someone please answer this question -2 Eligibility Requirements- Y.pdfCan someone please answer this question -2 Eligibility Requirements- Y.pdf
Can someone please answer this question -2 Eligibility Requirements- Y.pdf
 
Can somebody solve the TODO parts of the following problem- Thanks D.pdf
Can somebody solve the TODO parts of the following problem- Thanks   D.pdfCan somebody solve the TODO parts of the following problem- Thanks   D.pdf
Can somebody solve the TODO parts of the following problem- Thanks D.pdf
 
can someone fix the errors in this code- the name needs to be Fraction.pdf
can someone fix the errors in this code- the name needs to be Fraction.pdfcan someone fix the errors in this code- the name needs to be Fraction.pdf
can someone fix the errors in this code- the name needs to be Fraction.pdf
 
Can a student attending an American university raise First Amendment o.pdf
Can a student attending an American university raise First Amendment o.pdfCan a student attending an American university raise First Amendment o.pdf
Can a student attending an American university raise First Amendment o.pdf
 
can a groundwater sample with a low redox potential could indicate a-.pdf
can a groundwater sample with a low redox potential could indicate a-.pdfcan a groundwater sample with a low redox potential could indicate a-.pdf
can a groundwater sample with a low redox potential could indicate a-.pdf
 
Calculate FIS-FST- and FIT for the population with genotype frequencie.pdf
Calculate FIS-FST- and FIT for the population with genotype frequencie.pdfCalculate FIS-FST- and FIT for the population with genotype frequencie.pdf
Calculate FIS-FST- and FIT for the population with genotype frequencie.pdf
 
C language Make a program to get utime and stime From -proc-pid-stat-.pdf
C language Make a program to get utime and stime  From -proc-pid-stat-.pdfC language Make a program to get utime and stime  From -proc-pid-stat-.pdf
C language Make a program to get utime and stime From -proc-pid-stat-.pdf
 
Calculate the Current Ratios- (Please show the formula) CompanyCurre.pdf
Calculate the Current Ratios- (Please show the formula)   CompanyCurre.pdfCalculate the Current Ratios- (Please show the formula)   CompanyCurre.pdf
Calculate the Current Ratios- (Please show the formula) CompanyCurre.pdf
 
Calculate the amount of money Sean had to deposit in an investment fun.pdf
Calculate the amount of money Sean had to deposit in an investment fun.pdfCalculate the amount of money Sean had to deposit in an investment fun.pdf
Calculate the amount of money Sean had to deposit in an investment fun.pdf
 
Calculate FST for the random-mating subpopulations below based on the.pdf
Calculate FST for the random-mating subpopulations below based on the.pdfCalculate FST for the random-mating subpopulations below based on the.pdf
Calculate FST for the random-mating subpopulations below based on the.pdf
 
CALCIUM PATHWAY trace a calcium ion from the small intestine to the in.pdf
CALCIUM PATHWAY trace a calcium ion from the small intestine to the in.pdfCALCIUM PATHWAY trace a calcium ion from the small intestine to the in.pdf
CALCIUM PATHWAY trace a calcium ion from the small intestine to the in.pdf
 
Cadux Candy Company's income statement for the year ended December 31-.pdf
Cadux Candy Company's income statement for the year ended December 31-.pdfCadux Candy Company's income statement for the year ended December 31-.pdf
Cadux Candy Company's income statement for the year ended December 31-.pdf
 
Calcium - Selonosis- characterized by hair loss- weile blotchy mail- g.pdf
Calcium - Selonosis- characterized by hair loss- weile blotchy mail- g.pdfCalcium - Selonosis- characterized by hair loss- weile blotchy mail- g.pdf
Calcium - Selonosis- characterized by hair loss- weile blotchy mail- g.pdf
 

Recently uploaded

80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningMarc Dusseiller Dusjagr
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17Celine George
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfstareducators107
 

Recently uploaded (20)

80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 

Can you fix the problem with the following code #include -iostream- #.pdf

  • 1. Can you fix the problem with the following code #include <iostream> #include <iomanip> using namespace std; class bankAccount {public: bankAccount(int,double); void setAccNum(int); int getAccNum(); double getBalance(); void withdraw(double); void deposit(double); void print(); protected: int accNum; double balance; }; class savingsAccount: public bankAccount {public: savingsAccount(int,double); void setRate(double); double getRate(); void withdraw(double); void postInterest(); void savingsAccount::print(); protected: double rate; }; class checkingAccount: public bankAccount { public: checkingAccount(int accNum,double bal); double getMinBal(); double getRate(); double getFee(); void setMinBal(double); void setRate(double); void setFee(double); void postInterest(); bool checkMinBal(double); void checkingAccount::writeCheck(double); void withdraw(double); void print(); protected: double rate,minBal,fee;
  • 2. }; bankAccount::bankAccount(int n,double b) {accNum=n; balance=b; } void bankAccount::setAccNum(int a) {accNum=a; } int bankAccount::getAccNum() {return accNum; } double bankAccount::getBalance() {return balance; } void bankAccount::withdraw(double a) {balance-=a; } void bankAccount::deposit(double a) {balance+=a; } void bankAccount::print() {cout<<accNum<<"Balance: $"<<setprecision(2)<<fixed<<balance<<endl; } checkingAccount::checkingAccount(int n,double b):bankAccount(n,b) {setRate(.04); setMinBal(500); setFee(20); } double checkingAccount::getMinBal() {return minBal; } double checkingAccount::getRate() {return rate; } double checkingAccount::getFee() {return fee; } void checkingAccount::setMinBal(double m) {minBal=m; } void checkingAccount::setRate(double r) {rate=r; } void checkingAccount::setFee(double f) {fee=f; }
  • 3. void checkingAccount::postInterest() {balance+=(balance*rate); } bool checkingAccount::checkMinBal(double a) {if(balance-a>=minBal) return true; else return false; } void checkingAccount::writeCheck(double a) {withdraw(a); } void checkingAccount::withdraw(double a) {if(balance-a<0) cout<<"insufficient funds for $"<<a<<" withdrawaln"; else if(balance-a<minBal) if(balance-a-fee<minBal) cout<<"insufficient funds for withdrawal + fees, since balance will be below minimumn"; else {cout<<"balance below minimum. $"<<fee<<" fee chargedn"; balance-=(a+fee); } else balance-=a; } void checkingAccount::print() {cout<<"Interest Checking ACCT#:t"<<getAccNum() <<"tBalance: $"<<setprecision(2)<<fixed<<getBalance()<<endl; } savingsAccount::savingsAccount(int n,double b):bankAccount(n,b) {setRate(.06); } double savingsAccount::getRate() {return rate; } void savingsAccount::setRate(double r) {rate=r; } void savingsAccount::withdraw(double a) {if(balance-a<0) cout<<"insufficient funds for $"<<setprecision(2)<<fixed<<" withdrawaln"; else balance-=a; } void savingsAccount::postInterest() {balance+=(balance*rate);
  • 4. } void savingsAccount::print() {cout<<"Savings ACCT#:ttt"<<getAccNum() <<"tBalance: $"<<setprecision(2)<<fixed<<getBalance()<<endl; } int main() { checkingAccount a(1234,1000); checkingAccount b(5678, 450); savingsAccount c(91011, 9300); savingsAccount d(121314, 32); a.deposit(1000); b.deposit(2300); c.deposit(800); d.deposit(500); a.postInterest(); b.postInterest(); c.postInterest(); d.postInterest(); a.print(); b.print(); c.print(); d.print(); a.writeCheck(250); b.writeCheck(350); c.withdraw(120); d.withdraw(290); a.print(); b.print(); c.print(); d.print(); system("pause"); return 0; }