Sie sind auf Seite 1von 3

/*

* To change this license header, choose License Headers in Project Properties.


* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package assign;
import java.util.Scanner;
/**
*
* @author Joshua
*/
public class Assign {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String Full,Install;
double pay;
System.out.print("Enter name: ");
String name;
name=input.nextLine();
System.out.print("Enter course: ");
String course;
course=input.nextLine();
System.out.print("Enter section: ");
String sec;
sec=input.nextLine();
System.out.println("***TUITION FEE PAYMENT SYSTEM***");
System.out.print("Enter the amount of tuition fee: ");
pay=input.nextDouble();
String fee;
fee = input.nextLine();
System.out.println("[F]ull payment");
System.out.println("
[1]Cash");
System.out.println("
[2]Cheque");
System.out.println("[I]nstallment");
System.out.println("
[1]Monthly");
System.out.println("
[2]Quarterly");
Scanner input1=new Scanner(System.in);
System.out.println("Press [F] for full payment: [I] for installment: ");
Full=input1.nextLine();
Install=Full.toLowerCase();
switch(Full)
{
case "e" :
System.out.print("Good Day. Good Bye. God Bles
s Us! Thank You!:) ");
break;
case("f"):
System.out.println("You have Chosen to pay in Full");
System.out.println("You could avail our 10% discount.");
System.out.print("Press [1] for cash payment : [2] for c

heque payment :");


Full=input1.nextLine();
switch(Full){
case"1":
System.out.print("Thank you for paying in cash.");
System.out.println("Your total amount due is: " + (pay-pay*.
10));
System.out.println("*****RECIEPT*****");
System.out.println("Name: " + name);
System.out.println("Course: " + course);
System.out.println("Section: " + sec);
System.out.println("Payment type: Full Payment ");
System.out.println("You get a Discount: 10%");
System.out.println("Tuition Fee: ");
System.out.println("Thank you! Good bye!");
break;
case"2":
System.out.println("Your cheque payment would be cleared aft
er three days.");
System.out.println("Your total amount due is: ");
System.out.println("*****RECIEPT*****");
System.out.println("Name: " + name);
System.out.println("Course: " + course);
System.out.println("Section: " + sec);
System.out.println("Payment type: Full Payment ");
System.out.println("You get a Discount: 10%");
System.out.println("Tuition Fee: " );
System.out.println("Thank you! Good bye!");
break;
}
break;
case"i":
System.out.print("Press [1] for Monthly basis : [2] for
Quarterly :");
Full=input1.nextLine();
switch(Full){
case "1" :
System.out.println("Your monthly due is: " + (pay/4));
System.out.println("*****RECIEPT*****");
System.out.println("Name: " + name);
System.out.println("Course: " + course);
System.out.println("Section: " + sec);
System.out.println("Payment type: Monthly Basis ");
System.out.println("Tuition Fee: " + (pay/4));
System.out.println("Thank you! Good bye!");
break;
case "2" :
System.out.println("Your monthly due is: " + (pay/2));
System.out.println("*****RECIEPT*****");
System.out.println("Name: " + name);
System.out.println("Course: " + course);
System.out.println("Section: " + sec);
System.out.println("Payment type: Quarterly ");
System.out.println("Tuition Fee: " + (pay/2));

System.out.println("Thank you! Good bye!");


break;
// TODO code application logic here
}
}
}
}

Das könnte Ihnen auch gefallen