Advertisement
cesarnascimento

Untitled

Sep 8th, 2017
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. package df;
  2.  
  3. public class ContaCorrente {
  4.  
  5.     String numero;
  6.     String agencia;
  7.     boolean especial;
  8.     double limiteEspecial;
  9.     double saldo;
  10.    
  11.    
  12.      boolean realizarSaque(double quantiaASacar) {
  13.    
  14.         if(saldo >= quantiaASacar) {
  15.            
  16.             saldo -= quantiaASacar;
  17.             return true;
  18.            
  19.         }else {
  20.             if(especial) {
  21.                
  22.             }else {
  23.                 return false;
  24.             }
  25.         }
  26.        
  27.     }
  28.    
  29. }
  30.  
  31.  
  32. //main
  33.  
  34. package df;
  35.  
  36. public class Main {
  37.  
  38.     public static void main(String[] args) {
  39.        
  40.         ContaCorrente conta = new ContaCorrente();
  41.        
  42.         conta.numero = "123456";
  43.         conta.agencia = "1234";
  44.         conta.especial = true;
  45.         conta.limiteEspecial = 4000;
  46.         conta.saldo = 10;
  47.        
  48.         System.out.println("Saldo da conta: "+conta.saldo);
  49.        
  50.        
  51.        
  52.  
  53.     }
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement