mirror of
https://github.com/Ladebeze66/cpp-partie-1.git
synced 2026-11-09 13:17:15 +01:00
ccp
This commit is contained in:
18
cpp00/ex02/.vscode/c_cpp_properties.json
vendored
Normal file
18
cpp00/ex02/.vscode/c_cpp_properties.json
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "linux-gcc-x64",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**"
|
||||
],
|
||||
"compilerPath": "/usr/bin/gcc",
|
||||
"cStandard": "${default}",
|
||||
"cppStandard": "${default}",
|
||||
"intelliSenseMode": "linux-gcc-x64",
|
||||
"compilerArgs": [
|
||||
""
|
||||
]
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
24
cpp00/ex02/.vscode/launch.json
vendored
Normal file
24
cpp00/ex02/.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "C/C++ Runner: Debug Session",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"args": [],
|
||||
"stopAtEntry": false,
|
||||
"externalConsole": false,
|
||||
"cwd": "/home/fgras-ca/Bureau/fgras-ca/CPP/cpp00/ex02",
|
||||
"program": "/home/fgras-ca/Bureau/fgras-ca/CPP/cpp00/ex02/build/Debug/outDebug",
|
||||
"MIMode": "gdb",
|
||||
"miDebuggerPath": "gdb",
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
59
cpp00/ex02/.vscode/settings.json
vendored
Normal file
59
cpp00/ex02/.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"C_Cpp_Runner.cCompilerPath": "gcc",
|
||||
"C_Cpp_Runner.cppCompilerPath": "g++",
|
||||
"C_Cpp_Runner.debuggerPath": "gdb",
|
||||
"C_Cpp_Runner.cStandard": "",
|
||||
"C_Cpp_Runner.cppStandard": "",
|
||||
"C_Cpp_Runner.msvcBatchPath": "",
|
||||
"C_Cpp_Runner.useMsvc": false,
|
||||
"C_Cpp_Runner.warnings": [
|
||||
"-Wall",
|
||||
"-Wextra",
|
||||
"-Wpedantic",
|
||||
"-Wshadow",
|
||||
"-Wformat=2",
|
||||
"-Wcast-align",
|
||||
"-Wconversion",
|
||||
"-Wsign-conversion",
|
||||
"-Wnull-dereference"
|
||||
],
|
||||
"C_Cpp_Runner.msvcWarnings": [
|
||||
"/W4",
|
||||
"/permissive-",
|
||||
"/w14242",
|
||||
"/w14287",
|
||||
"/w14296",
|
||||
"/w14311",
|
||||
"/w14826",
|
||||
"/w44062",
|
||||
"/w44242",
|
||||
"/w14905",
|
||||
"/w14906",
|
||||
"/w14263",
|
||||
"/w44265",
|
||||
"/w14928"
|
||||
],
|
||||
"C_Cpp_Runner.enableWarnings": true,
|
||||
"C_Cpp_Runner.warningsAsError": false,
|
||||
"C_Cpp_Runner.compilerArgs": [],
|
||||
"C_Cpp_Runner.linkerArgs": [],
|
||||
"C_Cpp_Runner.includePaths": [],
|
||||
"C_Cpp_Runner.includeSearch": [
|
||||
"*",
|
||||
"**/*"
|
||||
],
|
||||
"C_Cpp_Runner.excludeSearch": [
|
||||
"**/build",
|
||||
"**/build/**",
|
||||
"**/.*",
|
||||
"**/.*/**",
|
||||
"**/.vscode",
|
||||
"**/.vscode/**"
|
||||
],
|
||||
"C_Cpp_Runner.useAddressSanitizer": false,
|
||||
"C_Cpp_Runner.useUndefinedSanitizer": false,
|
||||
"C_Cpp_Runner.useLeakSanitizer": false,
|
||||
"C_Cpp_Runner.showCompilationTime": false,
|
||||
"C_Cpp_Runner.useLinkTimeOptimization": false,
|
||||
"C_Cpp_Runner.msvcSecureNoWarnings": false
|
||||
}
|
||||
59
cpp00/ex02/19920104_091532.log
Normal file
59
cpp00/ex02/19920104_091532.log
Normal file
@@ -0,0 +1,59 @@
|
||||
[19920104_091532] index:0;amount:42;created
|
||||
[19920104_091532] index:1;amount:54;created
|
||||
[19920104_091532] index:2;amount:957;created
|
||||
[19920104_091532] index:3;amount:432;created
|
||||
[19920104_091532] index:4;amount:1234;created
|
||||
[19920104_091532] index:5;amount:0;created
|
||||
[19920104_091532] index:6;amount:754;created
|
||||
[19920104_091532] index:7;amount:16576;created
|
||||
[19920104_091532] accounts:8;total:20049;deposits:0;withdrawals:0
|
||||
[19920104_091532] index:0;amount:42;deposits:0;withdrawals:0
|
||||
[19920104_091532] index:1;amount:54;deposits:0;withdrawals:0
|
||||
[19920104_091532] index:2;amount:957;deposits:0;withdrawals:0
|
||||
[19920104_091532] index:3;amount:432;deposits:0;withdrawals:0
|
||||
[19920104_091532] index:4;amount:1234;deposits:0;withdrawals:0
|
||||
[19920104_091532] index:5;amount:0;deposits:0;withdrawals:0
|
||||
[19920104_091532] index:6;amount:754;deposits:0;withdrawals:0
|
||||
[19920104_091532] index:7;amount:16576;deposits:0;withdrawals:0
|
||||
[19920104_091532] index:0;p_amount:42;deposit:5;amount:47;nb_deposits:1
|
||||
[19920104_091532] index:1;p_amount:54;deposit:765;amount:819;nb_deposits:1
|
||||
[19920104_091532] index:2;p_amount:957;deposit:564;amount:1521;nb_deposits:1
|
||||
[19920104_091532] index:3;p_amount:432;deposit:2;amount:434;nb_deposits:1
|
||||
[19920104_091532] index:4;p_amount:1234;deposit:87;amount:1321;nb_deposits:1
|
||||
[19920104_091532] index:5;p_amount:0;deposit:23;amount:23;nb_deposits:1
|
||||
[19920104_091532] index:6;p_amount:754;deposit:9;amount:763;nb_deposits:1
|
||||
[19920104_091532] index:7;p_amount:16576;deposit:20;amount:16596;nb_deposits:1
|
||||
[19920104_091532] accounts:8;total:21524;deposits:8;withdrawals:0
|
||||
[19920104_091532] index:0;amount:47;deposits:1;withdrawals:0
|
||||
[19920104_091532] index:1;amount:819;deposits:1;withdrawals:0
|
||||
[19920104_091532] index:2;amount:1521;deposits:1;withdrawals:0
|
||||
[19920104_091532] index:3;amount:434;deposits:1;withdrawals:0
|
||||
[19920104_091532] index:4;amount:1321;deposits:1;withdrawals:0
|
||||
[19920104_091532] index:5;amount:23;deposits:1;withdrawals:0
|
||||
[19920104_091532] index:6;amount:763;deposits:1;withdrawals:0
|
||||
[19920104_091532] index:7;amount:16596;deposits:1;withdrawals:0
|
||||
[19920104_091532] index:0;p_amount:47;withdrawal:refused
|
||||
[19920104_091532] index:1;p_amount:819;withdrawal:34;amount:785;nb_withdrawals:1
|
||||
[19920104_091532] index:2;p_amount:1521;withdrawal:657;amount:864;nb_withdrawals:1
|
||||
[19920104_091532] index:3;p_amount:434;withdrawal:4;amount:430;nb_withdrawals:1
|
||||
[19920104_091532] index:4;p_amount:1321;withdrawal:76;amount:1245;nb_withdrawals:1
|
||||
[19920104_091532] index:5;p_amount:23;withdrawal:refused
|
||||
[19920104_091532] index:6;p_amount:763;withdrawal:657;amount:106;nb_withdrawals:1
|
||||
[19920104_091532] index:7;p_amount:16596;withdrawal:7654;amount:8942;nb_withdrawals:1
|
||||
[19920104_091532] accounts:8;total:12442;deposits:8;withdrawals:6
|
||||
[19920104_091532] index:0;amount:47;deposits:1;withdrawals:0
|
||||
[19920104_091532] index:1;amount:785;deposits:1;withdrawals:1
|
||||
[19920104_091532] index:2;amount:864;deposits:1;withdrawals:1
|
||||
[19920104_091532] index:3;amount:430;deposits:1;withdrawals:1
|
||||
[19920104_091532] index:4;amount:1245;deposits:1;withdrawals:1
|
||||
[19920104_091532] index:5;amount:23;deposits:1;withdrawals:0
|
||||
[19920104_091532] index:6;amount:106;deposits:1;withdrawals:1
|
||||
[19920104_091532] index:7;amount:8942;deposits:1;withdrawals:1
|
||||
[19920104_091532] index:0;amount:47;closed
|
||||
[19920104_091532] index:1;amount:785;closed
|
||||
[19920104_091532] index:2;amount:864;closed
|
||||
[19920104_091532] index:3;amount:430;closed
|
||||
[19920104_091532] index:4;amount:1245;closed
|
||||
[19920104_091532] index:5;amount:23;closed
|
||||
[19920104_091532] index:6;amount:106;closed
|
||||
[19920104_091532] index:7;amount:8942;closed
|
||||
119
cpp00/ex02/Account.cpp
Normal file
119
cpp00/ex02/Account.cpp
Normal file
@@ -0,0 +1,119 @@
|
||||
// ************************************************************************** //
|
||||
// //
|
||||
// Account.cpp for GlobalBanksters United //
|
||||
// Created on : Sat Dec 23 19:43:15 2023 //
|
||||
// //
|
||||
// Made by : fgras-ca //
|
||||
// //
|
||||
// ************************************************************************** //
|
||||
|
||||
#include "Account.hpp"
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <ctime>
|
||||
#include <iomanip>
|
||||
|
||||
// Initialisation des variables statiques
|
||||
int Account::_nbAccounts = 0;
|
||||
int Account::_totalAmount = 0;
|
||||
int Account::_totalNbDeposits = 0;
|
||||
int Account::_totalNbWithdrawals = 0;
|
||||
|
||||
// Constructeur : Initialise un compte avec un dépôt initial et met à jour les informations globales
|
||||
Account::Account(int initial_deposit) : _amount(initial_deposit), _nbDeposits(0), _nbWithdrawals(0)
|
||||
{
|
||||
_accountIndex = _nbAccounts++; // Assignation d'un index unique au compte et incrémentation du nombre total de comptes
|
||||
_totalAmount += _amount; // Mise à jour du montant total détenu par tous les comptes
|
||||
_displayTimestamp(); // Affichage de l'horodatage de la création du compte
|
||||
std::cout << "index:" << _accountIndex << ";amount:" << _amount << ";created\n"; // Enregistrement de la création du compte
|
||||
}
|
||||
|
||||
// Destructeur : Met à jour les informations globales lors de la fermeture d'un compte
|
||||
Account::~Account()
|
||||
{
|
||||
_nbAccounts--; // Décrémentation du nombre total de comptes
|
||||
_totalAmount -= _amount; // Mise à jour du montant total détenu par tous les comptes
|
||||
_displayTimestamp(); // Affichage de l'horodatage de la fermeture du compte
|
||||
std::cout << "index:" << _accountIndex << ";amount:" << _amount << ";closed\n"; // Enregistrement de la fermeture du compte
|
||||
}
|
||||
|
||||
// Dépôts : Ajoute un montant au compte et met à jour les informations globales
|
||||
void Account::makeDeposit(int deposit)
|
||||
{
|
||||
_displayTimestamp(); // Affichage de l'horodatage de l'opération
|
||||
std::cout << "index:" << _accountIndex << ";p_amount:" << _amount << ";deposit:" << deposit;
|
||||
_amount += deposit; // Mise à jour du montant dans le compte
|
||||
_nbDeposits++; // Incrémentation du nombre de dépôts pour ce compte
|
||||
_totalAmount += deposit; // Mise à jour du montant total détenu par tous les comptes
|
||||
_totalNbDeposits++; // Incrémentation du nombre total de dépôts effectués sur tous les comptes
|
||||
std::cout << ";amount:" << _amount << ";nb_deposits:" << _nbDeposits << "\n"; // Enregistrement de l'opération de dépôt
|
||||
}
|
||||
|
||||
// Retraits : Diminue le montant du compte si possible et met à jour les informations globales
|
||||
bool Account::makeWithdrawal(int withdrawal)
|
||||
{
|
||||
_displayTimestamp(); // Affichage de l'horodatage de l'opération
|
||||
std::cout << "index:" << _accountIndex << ";p_amount:" << _amount << ";withdrawal:";
|
||||
if (withdrawal > _amount)
|
||||
{ // Vérification si le retrait est possible (fonds suffisants)
|
||||
std::cout << "refused\n"; // Enregistrement d'un retrait refusé
|
||||
return (false);
|
||||
}
|
||||
_amount -= withdrawal; // Mise à jour du montant dans le compte
|
||||
_nbWithdrawals++; // Incrémentation du nombre de retraits pour ce compte
|
||||
_totalAmount -= withdrawal; // Mise à jour du montant total détenu par tous les comptes
|
||||
_totalNbWithdrawals++; // Incrémentation du nombre total de retraits effectués sur tous les comptes
|
||||
std::cout << withdrawal << ";amount:" << _amount << ";nb_withdrawals:" << _nbWithdrawals << "\n"; // Enregistrement de l'opération de retrait
|
||||
return (true);
|
||||
}
|
||||
|
||||
// Vérifier le montant : Retourne le montant actuel du compte
|
||||
int Account::checkAmount() const
|
||||
{
|
||||
return (_amount);
|
||||
}
|
||||
|
||||
// Afficher le statut du compte : Affiche les informations détaillées sur le compte
|
||||
void Account::displayStatus() const
|
||||
{
|
||||
_displayTimestamp(); // Affichage de l'horodatage de l'opération
|
||||
std::cout << "index:" << _accountIndex << ";amount:" << _amount
|
||||
<< ";deposits:" << _nbDeposits << ";withdrawals:" << _nbWithdrawals << "\n"; // Enregistrement de l'état actuel du compte
|
||||
}
|
||||
|
||||
// Retourner le nombre total de comptes
|
||||
int Account::getNbAccounts() { return _nbAccounts; }
|
||||
|
||||
// Retourner le montant total détenu par tous les comptes
|
||||
int Account::getTotalAmount() { return _totalAmount; }
|
||||
|
||||
// Retourner le nombre total de dépôts effectués sur tous les comptes
|
||||
int Account::getNbDeposits() { return _totalNbDeposits; }
|
||||
|
||||
// Retourner le nombre total de retraits effectués sur tous les comptes
|
||||
int Account::getNbWithdrawals() { return _totalNbWithdrawals; }
|
||||
|
||||
// Afficher les informations globales de tous les comptes
|
||||
void Account::displayAccountsInfos()
|
||||
{
|
||||
_displayTimestamp(); // Affichage de l'horodatage de l'opération
|
||||
std::cout << "accounts:" << getNbAccounts() << ";total:" << getTotalAmount()
|
||||
<< ";deposits:" << getNbDeposits() << ";withdrawals:" << getNbWithdrawals() << "\n"; // Enregistrement des informations globales
|
||||
}
|
||||
|
||||
void Account::_displayTimestamp()
|
||||
{
|
||||
// Obtenir l'heure et la date actuelles
|
||||
std::time_t now = std::time(nullptr);
|
||||
std::tm *ltm = std::localtime(&now);
|
||||
|
||||
std::cout << "["
|
||||
<< 1900 + ltm->tm_year // Ajouter 1900 pour obtenir l'année complète
|
||||
<< std::setw(2) << std::setfill('0') << 1 + ltm->tm_mon // Mois (0-11 donc +1 pour 1-12)
|
||||
<< std::setw(2) << std::setfill('0') << ltm->tm_mday // Jour (1-31)
|
||||
<< "_"
|
||||
<< std::setw(2) << std::setfill('0') << ltm->tm_hour // Heures (0-23)
|
||||
<< std::setw(2) << std::setfill('0') << ltm->tm_min // Minutes (0-59)
|
||||
<< std::setw(2) << std::setfill('0') << ltm->tm_sec // Secondes (0-59)
|
||||
<< "] ";
|
||||
}
|
||||
69
cpp00/ex02/Account.hpp
Normal file
69
cpp00/ex02/Account.hpp
Normal file
@@ -0,0 +1,69 @@
|
||||
// ************************************************************************** //
|
||||
// //
|
||||
// Account.hpp for GlobalBanksters United //
|
||||
// Created on : Thu Nov 20 19:43:15 1989 //
|
||||
// Last update : Wed Jan 04 14:54:06 1992 //
|
||||
// Made by : Brad "Buddy" McLane <bm@gbu.com> //
|
||||
// //
|
||||
// ************************************************************************** //
|
||||
|
||||
|
||||
#pragma once
|
||||
#ifndef __ACCOUNT_H__
|
||||
#define __ACCOUNT_H__
|
||||
|
||||
// ************************************************************************** //
|
||||
// Account Class //
|
||||
// ************************************************************************** //
|
||||
|
||||
class Account {
|
||||
|
||||
|
||||
public:
|
||||
|
||||
typedef Account t;
|
||||
|
||||
static int getNbAccounts( void );
|
||||
static int getTotalAmount( void );
|
||||
static int getNbDeposits( void );
|
||||
static int getNbWithdrawals( void );
|
||||
static void displayAccountsInfos( void );
|
||||
|
||||
Account( int initial_deposit );
|
||||
~Account( void );
|
||||
|
||||
void makeDeposit( int deposit );
|
||||
bool makeWithdrawal( int withdrawal );
|
||||
int checkAmount( void ) const;
|
||||
void displayStatus( void ) const;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
static int _nbAccounts;
|
||||
static int _totalAmount;
|
||||
static int _totalNbDeposits;
|
||||
static int _totalNbWithdrawals;
|
||||
|
||||
static void _displayTimestamp( void );
|
||||
|
||||
int _accountIndex;
|
||||
int _amount;
|
||||
int _nbDeposits;
|
||||
int _nbWithdrawals;
|
||||
|
||||
Account( void );
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
// ************************************************************************** //
|
||||
// vim: set ts=4 sw=4 tw=80 noexpandtab: //
|
||||
// -*- indent-tabs-mode:t; -*-
|
||||
// -*- mode: c++-mode; -*-
|
||||
// -*- fill-column: 75; comment-column: 75; -*-
|
||||
// ************************************************************************** //
|
||||
|
||||
|
||||
#endif /* __ACCOUNT_H__ */
|
||||
BIN
cpp00/ex02/Account.o
Normal file
BIN
cpp00/ex02/Account.o
Normal file
Binary file not shown.
50
cpp00/ex02/Makefile
Normal file
50
cpp00/ex02/Makefile
Normal file
@@ -0,0 +1,50 @@
|
||||
LOGO = @echo " __, ____, ____, ____, ____ ____, ___, ____,";\
|
||||
echo "(-| (-/_| (-| \ (-|_, (-|__) (-|_, (- / (-|_,";\
|
||||
echo " _|__, _/ |, _|__/ _|__, _|__) _|__, _/__, _|__,";\
|
||||
echo "( ( ( ( ( ( ( ("
|
||||
|
||||
DEF_COLOR = \033[0m
|
||||
GRAY = \033[0;90m
|
||||
RED = \033[0;91m
|
||||
GREEN = \033[0;92m
|
||||
YELLOW = \033[0;93m
|
||||
BLUE = \033[0;94m
|
||||
MAGENTA = \033[0;95m
|
||||
CYAN = \033[0;96m
|
||||
WHITE = \033[0;97m
|
||||
ORANGE = \033[38;5;214m
|
||||
|
||||
NAME = bank
|
||||
|
||||
SRC = Account.cpp \
|
||||
tests.cpp \
|
||||
|
||||
OBJS = ${SRC:.cpp=.o}
|
||||
|
||||
CC = c++
|
||||
CFLAGS = -Wall -Werror -Wextra -std=c++98
|
||||
RM = rm -f
|
||||
|
||||
all : $(NAME)
|
||||
|
||||
$(NAME) : $(OBJS)
|
||||
@echo "$(RED)Compilation Account Bank... $(DEF_COLOR)"
|
||||
$(CC) $(CFLAGS) $(OBJS) -g -o $(NAME)
|
||||
@echo "$(GREEN)Compilation complete. $(ORANGE)Type "./bank"$(DEF_COLOR)"
|
||||
$(LOGO)
|
||||
|
||||
clean :
|
||||
@echo "$(RED)Deleating files objects... $(DEF_COLOR)"
|
||||
$(RM) $(OBJS)
|
||||
@echo "$(GREEN)files deleted!! $(DEF_COLOR)"
|
||||
$(LOGO)
|
||||
|
||||
fclean : clean
|
||||
@echo "$(RED)Delete program name... $(DEF_COLOR)"
|
||||
$(RM) $(NAME)
|
||||
@echo "$(GREEN)File program deleted!! $(DEF_COLOR)"
|
||||
$(LOGO)
|
||||
|
||||
re : fclean all
|
||||
|
||||
.PHONY : all clean fclean re
|
||||
BIN
cpp00/ex02/bank
Executable file
BIN
cpp00/ex02/bank
Executable file
Binary file not shown.
72
cpp00/ex02/tests.cpp
Normal file
72
cpp00/ex02/tests.cpp
Normal file
@@ -0,0 +1,72 @@
|
||||
// ************************************************************************** //
|
||||
// //
|
||||
// tests.cpp for GlobalBanksters United //
|
||||
// Created on : Thu Nov 20 23:45:02 1989 //
|
||||
// Last update : Wed Jan 04 09:23:52 1992 //
|
||||
// Made by : Brad "Buddy" McLane <bm@gbu.com> //
|
||||
// //
|
||||
// ************************************************************************** //
|
||||
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include "Account.hpp"
|
||||
|
||||
|
||||
int main( void ) {
|
||||
|
||||
typedef std::vector<Account::t> accounts_t;
|
||||
typedef std::vector<int> ints_t;
|
||||
typedef std::pair<accounts_t::iterator, ints_t::iterator> acc_int_t;
|
||||
|
||||
int const amounts[] = { 42, 54, 957, 432, 1234, 0, 754, 16576 };
|
||||
size_t const amounts_size( sizeof(amounts) / sizeof(int) );
|
||||
accounts_t accounts( amounts, amounts + amounts_size );
|
||||
accounts_t::iterator acc_begin = accounts.begin();
|
||||
accounts_t::iterator acc_end = accounts.end();
|
||||
|
||||
int const d[] = { 5, 765, 564, 2, 87, 23, 9, 20 };
|
||||
size_t const d_size( sizeof(d) / sizeof(int) );
|
||||
ints_t deposits( d, d + d_size );
|
||||
ints_t::iterator dep_begin = deposits.begin();
|
||||
ints_t::iterator dep_end = deposits.end();
|
||||
|
||||
int const w[] = { 321, 34, 657, 4, 76, 275, 657, 7654 };
|
||||
size_t const w_size( sizeof(w) / sizeof(int) );
|
||||
ints_t withdrawals( w, w + w_size );
|
||||
ints_t::iterator wit_begin = withdrawals.begin();
|
||||
ints_t::iterator wit_end = withdrawals.end();
|
||||
|
||||
Account::displayAccountsInfos();
|
||||
std::for_each( acc_begin, acc_end, std::mem_fun_ref( &Account::displayStatus ) );
|
||||
|
||||
for ( acc_int_t it( acc_begin, dep_begin );
|
||||
it.first != acc_end && it.second != dep_end;
|
||||
++(it.first), ++(it.second) ) {
|
||||
|
||||
(*(it.first)).makeDeposit( *(it.second) );
|
||||
}
|
||||
|
||||
Account::displayAccountsInfos();
|
||||
std::for_each( acc_begin, acc_end, std::mem_fun_ref( &Account::displayStatus ) );
|
||||
|
||||
for ( acc_int_t it( acc_begin, wit_begin );
|
||||
it.first != acc_end && it.second != wit_end;
|
||||
++(it.first), ++(it.second) ) {
|
||||
|
||||
(*(it.first)).makeWithdrawal( *(it.second) );
|
||||
}
|
||||
|
||||
Account::displayAccountsInfos();
|
||||
std::for_each( acc_begin, acc_end, std::mem_fun_ref( &Account::displayStatus ) );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************** //
|
||||
// vim: set ts=4 sw=4 tw=80 noexpandtab: //
|
||||
// -*- indent-tabs-mode:t; -*-
|
||||
// -*- mode: c++-mode; -*-
|
||||
// -*- fill-column: 75; comment-column: 75; -*-
|
||||
// ************************************************************************** //
|
||||
BIN
cpp00/ex02/tests.o
Normal file
BIN
cpp00/ex02/tests.o
Normal file
Binary file not shown.
Reference in New Issue
Block a user