Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class E01tripToWorldCup {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double flightPrice = Double.parseDouble(scanner.nextLine());
- double returnPrice = Double.parseDouble(scanner.nextLine());
- double matchTicket = Double.parseDouble(scanner.nextLine());
- double matchQuantity = Double.parseDouble(scanner.nextLine());
- double discount = Double.parseDouble(scanner.nextLine());
- double totalFlightTickets = (flightPrice + returnPrice);
- double totalFlightTicketsAfterDiscount = totalFlightTickets - (totalFlightTickets * (discount / 100));
- double eachBill = totalFlightTicketsAfterDiscount + (matchQuantity * matchTicket);
- double TOTAL = eachBill * 6;
- System.out.printf("Total sum: %.2f lv.%n", TOTAL);
- System.out.printf("Each friend has to pay %.2f lv.", eachBill);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment