Initial Course
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace oop {
|
||||
|
||||
class BankAccount {
|
||||
public:
|
||||
explicit BankAccount(std::string owner, double balance = 0.0);
|
||||
|
||||
[[nodiscard]] auto owner() const -> const std::string&;
|
||||
[[nodiscard]] auto balance() const -> double;
|
||||
|
||||
void deposit(double amount);
|
||||
auto withdraw(double amount) -> bool;
|
||||
|
||||
private:
|
||||
std::string owner_;
|
||||
double balance_;
|
||||
};
|
||||
|
||||
} // namespace oop
|
||||
Reference in New Issue
Block a user