account: split class logic out and have it building
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
82b198f898
commit
bfa3196b62
4 changed files with 36 additions and 8 deletions
|
@ -6,7 +6,8 @@ using namespace std;
|
||||||
|
|
||||||
#include "account.h"
|
#include "account.h"
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
Account::Account ( double initial_balance ) : balance(initial_balance) {
|
||||||
Account account(0.0);
|
}
|
||||||
return EXIT_SUCCESS;
|
|
||||||
|
Account::~Account () {
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,10 +12,8 @@ class Account
|
||||||
/* ==================== LIFECYCLE ======================================= */
|
/* ==================== LIFECYCLE ======================================= */
|
||||||
//Account (); /* constructor */
|
//Account (); /* constructor */
|
||||||
//Account ( const Account &other ); /* copy constructor */
|
//Account ( const Account &other ); /* copy constructor */
|
||||||
Account ( double initial_balance ) : balance(initial_balance) {
|
Account ( double initial_balance );
|
||||||
}
|
~Account (); /* destructor */
|
||||||
~Account () { /* destructor */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ==================== ACCESSORS ======================================= */
|
/* ==================== ACCESSORS ======================================= */
|
||||||
|
|
||||||
|
|
29
main.cpp
Normal file
29
main.cpp
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
/*
|
||||||
|
* =====================================================================================
|
||||||
|
*
|
||||||
|
* Filename: main.cpp
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
*
|
||||||
|
* Version: 1.0
|
||||||
|
* Created: 02/08/2025 11:05:02 AM
|
||||||
|
* Revision: none
|
||||||
|
* Compiler: gcc
|
||||||
|
*
|
||||||
|
* Author: YOUR NAME (),
|
||||||
|
* Organization:
|
||||||
|
*
|
||||||
|
* =====================================================================================
|
||||||
|
*/
|
||||||
|
#include <iostream>
|
||||||
|
#include <cmath>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
|
#include "account.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main(int argc, char* argv[]) {
|
||||||
|
Account account(0.0);
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
|
@ -8,5 +8,5 @@ a = run_command('date', check: true)
|
||||||
read_exe = executable('read', 'read.c', link_language : 'c',)
|
read_exe = executable('read', 'read.c', link_language : 'c',)
|
||||||
readpp_exe = executable('read++', 'read++.cpp')
|
readpp_exe = executable('read++', 'read++.cpp')
|
||||||
|
|
||||||
account_sources = ['account.cpp', 'account.h']
|
account_sources = ['main.cpp', 'account.cpp', 'account.h']
|
||||||
account_exe = executable('account', account_sources)
|
account_exe = executable('account', account_sources)
|
||||||
|
|
Loading…
Add table
Reference in a new issue