Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // HANZ AUGUSTINE S. BERMEJO BSIT 1-D\\
- package javaapplication1;
- import java.util.Scanner;
- public class JavaApplication1 {
- public static void main(String[] args) {
- String name,hanz;
- int ticket, seat, rebookingfee, meal;
- double insurance, baggagew, totalAmount, Subtotal, baggagefee, Tax;
- final double iTax = 0.12;
- Scanner inp = new Scanner (System.in);
- System.out.println("Customer's Name: ");
- name = inp.nextLine();
- System.out.println("Price of ticket: ");
- ticket = inp.nextInt();
- System.out.println("Meal: ");
- meal = inp.nextInt();
- System.out.println("Insurance: ");
- insurance = inp.nextDouble();
- System.out.println("Seat#: ");
- seat = inp.nextInt();
- System.out.println("Rebooking Fee: ");
- rebookingfee = inp.nextInt();
- System.out.println("Weight of Baggage: ");
- baggagew = inp.nextDouble();
- if (baggagew >=20 && baggagew <=31){
- baggagefee = 700;
- }
- else if (baggagew >=32 && baggagew <=39 ) {
- baggagefee = 1350;
- }
- else if (baggagew>=40 && baggagew <=69){
- baggagefee = 1900;
- }
- else if (baggagew >=70 && baggagew <=90){
- baggagefee = 2500;
- }
- else {
- baggagefee = 2500;
- }
- Subtotal = (ticket + meal + rebookingfee + baggagefee + insurance);
- System.out.println("Subtotal:" + Subtotal);
- Tax = (Subtotal * iTax);
- System.out.println("Tax: " + iTax);
- totalAmount = (Subtotal + Tax);
- System.out.println("Total Ammount:" + totalAmount);
- System.exit(0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement