account: split class logic out and have it building

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2025-02-08 11:09:09 -05:00
parent 82b198f898
commit bfa3196b62
Signed by: vbatts
GPG key ID: E30EFAA812C6E5ED
4 changed files with 36 additions and 8 deletions

View file

@ -6,7 +6,8 @@ using namespace std;
#include "account.h"
int main(int argc, char* argv[]) {
Account account(0.0);
return EXIT_SUCCESS;
Account::Account ( double initial_balance ) : balance(initial_balance) {
}
Account::~Account () {
}

View file

@ -12,10 +12,8 @@ class Account
/* ==================== LIFECYCLE ======================================= */
//Account (); /* constructor */
//Account ( const Account &other ); /* copy constructor */
Account ( double initial_balance ) : balance(initial_balance) {
}
~Account () { /* destructor */
}
Account ( double initial_balance );
~Account (); /* destructor */
/* ==================== ACCESSORS ======================================= */

29
main.cpp Normal file
View 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;
}

View file

@ -8,5 +8,5 @@ a = run_command('date', check: true)
read_exe = executable('read', 'read.c', link_language : 'c',)
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)