Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Check Book Program I need to have a checkbook program that uses the following items. My code that I have appears below. 1) Math

C++ Check Book Program

I need to have a checkbook program that uses the following items. My code that I have appears below.

1) Math operations using built-in math functions

2) Class type in a separate .h file with member functions (accessor functions, get, set, show, display find, etc). There needs to be an overloaded function base/derived classes or a template.

3) Binary File

#include using namespace std; int main() { double checking,savings; cout<<"Enter the initial checking account balance :"; cin>>checking; cout<<"Enter the initial savings account balance :"; cin>>savings; double amt; while(1) { cout<<"Menu "; cout<<"Enter 1 to withdraw cash "; cout<<"Enter 2 to deposit cash "; cout<<"Enter 3 to transfer from/to savings account "; cout<<"Enter 4 to display the balances "; cout<<"Enter 5 to quit "; int choice; cin>>choice; switch(choice) { case 1: cout<<"Enter the amount of cash you want to withdraw :"; cin>>amt; if(amt>checking) { cout<<"You don't have enough balance in the checking account "; break; } else { checking=checking-amt; cout<<"Cash withdrawl complete "; } break; case 2: while(true) { cout<<"Enter the amount you want to deposit :"; cin>>amt; if(amt<=0) cout<<"Please enter a valid amount "; else break; } checking=checking+amt; cout<<"Amount deposit successful "; break; case 3: char ch; cout<<"Do you want to transfer to the savings account, Y/N :"; cin>>ch; if(ch=='Y') { while(true) { cout<<"Enter the amount you want to transfer to the savings account:"; cin>>amt; if(amt<=0 and amt>ch; if(ch=='Y') { cout<<"Enter the amount of cash you want to transfer from the savings account :"; cin>>amt; if(amt>savings) { cout<<"You don't have enough balance "; break; } else { checking=checking+amt; savings=savings-amt; } } cout<<"Transfer complete "; } break; case 4: cout<<"Your current savings account balance :$"<

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions