Initial Course
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#include "classes_and_objects.hpp"
|
||||
|
||||
namespace oop {
|
||||
|
||||
BankAccount::BankAccount(std::string owner, double balance)
|
||||
: owner_(std::move(owner)), balance_(balance) {}
|
||||
|
||||
auto BankAccount::owner() const -> const std::string& { return owner_; }
|
||||
auto BankAccount::balance() const -> double { return balance_; }
|
||||
|
||||
void BankAccount::deposit(double amount) {
|
||||
// TODO: Add amount when positive
|
||||
(void)amount;
|
||||
}
|
||||
|
||||
auto BankAccount::withdraw(double amount) -> bool {
|
||||
// TODO: Return false if insufficient funds, else subtract and return true
|
||||
(void)amount;
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace oop
|
||||
Reference in New Issue
Block a user