FareCode.txt - package gabrielleannesamson import java.util import java.text public class Act4 public static void main(String args Scanner input = new

FareCode.txt - package gabrielleannesamson import java.util...

This preview shows page 1 out of 1 page.

package gabrielleannesamson;import java.util.*;import java.text.*;public class Act4 {public static void main(String[] args) {Scanner input = new Scanner(System.in);DecimalFormat df = new DecimalFormat("###,###.00");double fare;System.out.print("Enter fare: ");fare=input.nextDouble();char type1;System.out.print("Passenger type [O,S,C]:");type1=input.next().charAt(0);char type2;System.out.print("Travelling in business class [Y/N]: ");type2=input.next().charAt(0);char code = 3;switch (code){case 1: System.out.print("Discount: " + df.format(fare/0)); System.out.println("Discounted fare: "); System.out.print("Business in class charge: "); System.out.print("New fare: "); break;
Background image

You've reached the end of your free preview.

Want to read the whole page?

  • Fall '19

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture