Advertisement
vp0415

lec3.2

Oct 21st, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class CreditLimitCalculator {
  5.  
  6.     public static void main(String[] args) {
  7.         Scanner input = new Scanner(System.in);
  8.         int accountNumber = 12;
  9.         int balanceBeginning = 100;
  10.          System.out.println("Enter credit");
  11.         int moneyWanted = input.nextInt() ;
  12.         int totalCharged = balanceBeginning + moneyWanted;
  13.         int totalAplied;
  14.         int allowedCredit = 1000;
  15.         int newBalance;
  16.        
  17.          if (moneyWanted <= allowedCredit)
  18.          {
  19.              newBalance = totalCharged;
  20.              System.out.println("New balance is " + newBalance);
  21.          }
  22.          else
  23.          {
  24.             System.out.println("Your credit exseeds your balance.");
  25.          }
  26.        
  27.  
  28.     }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement