SlideShare a Scribd company logo
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.pdf
archigallery1298
 
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.pdf
KUNALHARCHANDANI1
 
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
neerajsachdeva33
 
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
Pascal-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.pdf
annaindustries
 
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
akshay1213
 
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
kavithaarp
 
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
fatoryoutlets
 
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
anujmkt
 
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
rajeshjain2109
 
Generic programming
Generic programmingGeneric programming
Generic programming
Platonov Sergey
 
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
ankitcom
 
IP project for class 12 cbse
IP project for class 12 cbseIP project for class 12 cbse
IP project for class 12 cbse
siddharthjha34
 
public class NegativeAmountException extends Exception {    .pdf
public class NegativeAmountException extends Exception {     .pdfpublic class NegativeAmountException extends Exception {     .pdf
public class NegativeAmountException extends Exception {    .pdf
ARYAN20071
 
Statistics.hpp
Statistics.hppStatistics.hpp
Statistics.hpp
Vorname Nachname
 
5 Rmi Print
5  Rmi Print5  Rmi Print
5 Rmi Print
varadasuren
 

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.pdf
vinaythemodel
 
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
vinaythemodel
 
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
vinaythemodel
 
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
vinaythemodel
 
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
vinaythemodel
 
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
vinaythemodel
 
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
vinaythemodel
 
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
vinaythemodel
 
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
vinaythemodel
 
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
vinaythemodel
 
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
vinaythemodel
 
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
vinaythemodel
 
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
vinaythemodel
 
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
vinaythemodel
 
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
vinaythemodel
 
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
vinaythemodel
 
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
vinaythemodel
 
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
vinaythemodel
 
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
vinaythemodel
 
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
vinaythemodel
 

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

Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
AzmatAli747758
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 

Recently uploaded (20)

Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.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; }