Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Enrollment {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- String studName = "";
- int units = 0;
- double priceUnits = 0.0;
- double total = 0.0;
- double totalPaymentinCash = 0.0;
- double totalPayment2Install = 0.0;
- double totalPayment3Install = 0.0;
- double discount =0.0;
- System.out.print("Enter Student Name: ");
- studName = input.nextLine();
- System.out.print("Enter number of units enrolled: ");
- units = input.nextInt();
- System.out.print("Enter price per unit: ");
- priceUnits = input.nextDouble();
- total = units * priceUnits;
- System.out.println(studName + ", you could available the following payment mode:");
- System.out.println("Computed Tuition fee: " + total);
- System.out.println("Payment Mode:");
- discount = total * 0.1;
- totalPaymentinCash = total - discount;
- System.out.println("Cash Payment: " + totalPaymentinCash);
- discount = total * 0.05;
- totalPayment2Install = total + discount;
- System.out.println("2-installment: " + totalPayment2Install);
- discount = total * 0.1;
- totalPayment3Install = total + discount;
- System.out.println("3-installment: " + totalPayment3Install);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement