Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.39 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. Scanner input = new Scanner(System.in);
  4.        
  5.         String studName = "";
  6.         int units = 0;
  7.         double priceUnits = 0.0;
  8.         double total = 0.0;
  9.         double totalPaymentinCash = 0.0;
  10.         double totalPayment2Install = 0.0;
  11.         double totalPayment3Install = 0.0;
  12.         double discount =0.0;
  13.        
  14.         System.out.print("Enter Student Name: ");
  15.         studName = input.nextLine();
  16.        
  17.         System.out.print("Enter number of units enrolled: ");
  18.         units = input.nextInt();
  19.        
  20.         System.out.print("Enter price per unit: ");
  21.         priceUnits = input.nextDouble();
  22.        
  23.         total = units * priceUnits;
  24.        
  25.         System.out.println(studName + ", you could available the following payment mode:");
  26.         System.out.println("Computed Tuition fee: " + total);
  27.         System.out.println("Payment Mode:");
  28.        
  29.         discount = total * 0.1;
  30.         totalPaymentinCash = total - discount;
  31.          System.out.println("Cash Payment: " + totalPaymentinCash);
  32.          
  33.          discount = total * 0.05;
  34.          totalPayment2Install = total + discount;
  35.          System.out.println("2-installment: " + totalPayment2Install);
  36.          
  37.          discount = total * 0.1;
  38.          totalPayment3Install = total + discount;
  39.          System.out.println("3-installment: " + totalPayment3Install);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement