import java.util.Scanner ;
class ChiliToGoProfit
{
public static void main
( String [ ] args
) {
final double PROFIT_FOR_ADULT = 4.35 ;
final double PROFIT_FOR_CHILD = 3.10 ;
final double PRICE_FOR_ADULT = 7 ;
final double PRICE_FOR_CHILD = 4 ;
double adultMeals;
double childMeals;
Scanner scanner
= new Scanner
( System .
in ) ;
System .
out .
print ( "Input the number of adult meals:" ) ; adultMeals = scanner.nextDouble ( ) ;
System .
out .
println ( "Input the number of child meals:" ) ; childMeals = scanner.nextDouble ( ) ;
double totalPriceAdult = adultMeals * PRICE_FOR_ADULT;
double totalPriceChild = childMeals * PRICE_FOR_CHILD;
double totalPrice = totalPriceAdult + totalPriceChild;
double totalProfitAdult = adultMeals * ( PRICE_FOR_ADULT - PROFIT_FOR_ADULT) ;
double totalProfitChild = childMeals * ( PRICE_FOR_CHILD - PROFIT_FOR_CHILD) ;
double totalProfit = totalProfitAdult + totalProfitChild;
System .
out .
println ( "There are " + adultMeals
+ " adult meal(s)." ) ; System .
out .
println ( "There are " + childMeals
+ " child meal(s)." ) ; System .
out .
println ( "The total price of the meals is $" + totalPrice
) ; System .
out .
println ( "Total profit from adult meals is $" + totalProfitAdult
) ; System .
out .
println ( "Total profit from child meals is $" + totalProfitChild
) ; System .
out .
println ( "Grand profit from total amount of meals is $" + totalProfit
) ; }
}
aW1wb3J0IGphdmEudXRpbC5TY2FubmVyOwoKY2xhc3MgQ2hpbGlUb0dvUHJvZml0CnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSAKCXsKCQlmaW5hbCBkb3VibGUgUFJPRklUX0ZPUl9BRFVMVCA9IDQuMzU7CgkJZmluYWwgZG91YmxlIFBST0ZJVF9GT1JfQ0hJTEQgPSAzLjEwOwoJCWZpbmFsIGRvdWJsZSBQUklDRV9GT1JfQURVTFQgPSA3OwoJCWZpbmFsIGRvdWJsZSBQUklDRV9GT1JfQ0hJTEQgPSA0OwoJCQoJCWRvdWJsZSBhZHVs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