Advertisement
Guest User

Untitled

a guest
Oct 10th, 2015
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. public class Oef3 {
  2.  
  3.     public static void main(String[] args) {
  4.         // TODO Auto-generated method stub
  5.         Scanner keyboard = new Scanner(System.in);
  6.         System.out.println("amount?");
  7.         int a = keyboard.nextInt();
  8.         System.out.println("price?");
  9.         int b = keyboard.nextInt();
  10.         int c = a * b;
  11.         System.out.println("totaal: " + c);
  12.         if (c >= 1000) {
  13.             int d = c - 22;
  14.             System.out.println("-22€ korting");
  15.             System.out.println("Nieuw totaal: " + d);
  16.         } else {
  17.             if (c >= 500) {
  18.                 int d = c - 10;
  19.                 System.out.println("-10€ korting");
  20.                 System.out.println("Nieuw totaal: " + d);
  21.             }
  22.             keyboard.close();
  23.         }
  24.     }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement