Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String agency = scanner.nextLine();
- int tickets = Integer.parseInt(scanner.nextLine()),
- kidTickets = Integer.parseInt(scanner.nextLine());
- double ticketPrice = Double.parseDouble(scanner.nextLine()),
- service = Double.parseDouble(scanner.nextLine());
- double totalAdultTicketrice = (ticketPrice + service) * tickets,
- totalKidTicketrice = (0.3 * ticketPrice + service) * kidTickets,
- profit = (totalAdultTicketrice + totalKidTicketrice) / 5;
- System.out.printf("The profit of your agency from %s tickets is %.2f lv.", agency, profit);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement