Advertisement
Guest User

Untitled

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