Laborator 03
Problem 1:
Implement a Stack ( .push(), pop(), top(), isEmpty(), toString() )
Problem 2:
Implement a class with a fromJson(string json) constructor + toJson()
class Exemplu {
int varA;
int varB;
String varC;
List <int> varD;
double varE;
}
Problem 3:
a) Create a class called BankClient that has 3 private attributes:
- Id : which is generated automatically and represents the order of the clients in the bank Data Base (starting from 1 and can't be changed)
- Name (can't be changed)
- Balance has 3 methods (get, add, substractIfPossible). It will be initialized with 0 and can't be negative.
b) Create a constructor that uses "Initializer list" to initialize the name.
c) Create a static method that prints the number of clients and the bank balance.
d) Create a small test program (main).