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