Advertisement
veronikaaa86

07. Food Delivery

Oct 31st, 2021
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. package firstSteps;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class P07FoodDelivery {
  6. public static void main(String[] args) {
  7. Scanner scanner = new Scanner(System.in);
  8.  
  9. int countChicken = Integer.parseInt(scanner.nextLine());
  10. int countFish = Integer.parseInt(scanner.nextLine());
  11. int countVegan = Integer.parseInt(scanner.nextLine());
  12.  
  13. double priceAllChicken = countChicken * 10.35;
  14. double priceAllFish = countFish * 12.40;
  15. double priceAllVegan = countVegan * 8.15;
  16.  
  17. double priceAllMenus = priceAllChicken + priceAllFish + priceAllVegan;
  18. double dessertPrice = priceAllMenus * 0.20;
  19.  
  20. double totalPrice = priceAllMenus + dessertPrice + 2.5;
  21.  
  22. System.out.println(totalPrice);
  23. }
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement