Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Nota {
- int valorInicial;
- Nota(int valorInicial){
- if (valorInicial >= 0 && valorInicial <=10){
- this.valorInicial = valorInicial;
- }
- }
- int getValor(){
- return valorInicial;
- }
- boolean aprobado(){
- return (valorInicial >= 4);
- }
- boolean desaprobado(){
- return (valorInicial <= 4);
- }
- void recuperar(int nuevoValor){
- if (nuevoValor > valorInicial && nuevoValor > 0 && nuevoValor < 10){
- valorInicial = nuevoValor;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement