-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheckingAccount.h
More file actions
48 lines (33 loc) · 1.39 KB
/
Copy pathCheckingAccount.h
File metadata and controls
48 lines (33 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Declaration of the class CheckingAccount.
#include <iostream>
#include "BankAccount.h"
using namespace std;
#pragma once
//Class for a CheckingAccount which is derived from BankAccount.
class CheckingAccount : public BankAccount
{
public:
//Initializes the account balance to $dollars.cents and the check fee to fee.
CheckingAccount(int dollars, int cents, double fee);
//Initializes the account balance to $dollars.00 and check fee to the fee
CheckingAccount( int dollars, double fee);
//Initializes the account balance to $0.00 and the check fee to $0.00.
CheckingAccount( );
//Returns the check fee.
double get_fee( ) const;
void output(ostream& outs) const;
//Precondition: If outs is a file output stream, then outs has already been
//connected to a file.
//Postcondition: balance and check fee have been written to the stream outs.
void input(istream& ins);
//Precondition: If ins is a file input stream, then ins has already been
//connected to a file.
//Postcondition: balance and check fee have been read from the stream ins.
void check(int dollars, int cents);
// Precondition: dollars and cents must be greater or equal to 0.
// Dollars and cents be less than or equal to balance.
// Postcondition: increase the balance by the dollars and cents
// plus the fee.
private:
double check_fee;
};