#+title: Tp5

#+begin_src plantuml :file maquinaestado.jpg
skinparam classAttributeIconSize 0
abstract class State{
# account: Account
# balance: double
# interest: double
# lowerLimit: double
# upperLimit: double

+ Account: Account
+ Balance: double

+ <<abstract>> Deposit(double amount): void
+ <<abstract>> Withdraw(double amount): void
+ <<abstract>> PayInterest(): void
}

class RedState extends State{
- serviceFee: double
+ RedState(State state)

- Initialize(): void

+ <<override>> Deposit(double amount): void
+ <<override>> Withdraw(double amount): void
+ <<override>> PayInterest(): void

- StateChangeCheck(): void
}

class SilverState extends State {
+ SilverState(State state) : this(state.Balance, state.Account)
+ SilverState(double balance, Account account)
-  Initialize(): void
+ <<override>> void Deposit(double amount)
+ <<override>> Withdraw(double amount): void
+ <<override>> PayInterest(): void
- StateChangeCheck(): void
}
#+end_src

#+RESULTS:
[[file:maquinaestado.jpg]]
