Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ProgrammingBasicsExam;
- import java.util.Scanner;
- public class AgencyProfit {
- public static void main(String[] args) {
- Scanner scanner= new Scanner(System.in);
- String name=scanner.nextLine();
- int numTicket=Integer.parseInt(scanner.nextLine());
- int numChildrenTicket=Integer.parseInt(scanner.nextLine());
- double priceTicket=Double.parseDouble(scanner.nextLine());
- double pricePrice=Double.parseDouble(scanner.nextLine());
- double numOneChildren=priceTicket*0.30;
- double priceOld=priceTicket+pricePrice;
- double priceChildren=numOneChildren+pricePrice;
- double totalPrice=(numChildrenTicket*priceChildren)+(numTicket*priceOld);
- double profit=totalPrice-=totalPrice*0.80;
- System.out.printf("The profit of your agency from %s, tickets is %.2f lv.",profit);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement