Advertisement
Spocoman

07. Food Delivery

Aug 19th, 2024
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.80 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class FoodDelivery {
  4.     public static void main(String[] args) {
  5.  
  6.         Scanner scanner = new Scanner(System.in);
  7.         int chickenMenuCount = Integer.parseInt(scanner.nextLine());
  8.         int fishMenuCount = Integer.parseInt(scanner.nextLine());
  9.         int veganMenuCount = Integer.parseInt(scanner.nextLine());
  10.  
  11.         double chickenMenuPrice = 10.35;
  12.         double fishMenuPrice = 12.40;
  13.         double veganMenuPrice = 8.15;
  14.         double delivery = 2.50;
  15.  
  16.         double menuPrice = chickenMenuCount * chickenMenuPrice + fishMenuCount * fishMenuPrice + veganMenuCount * veganMenuPrice;
  17.         double dessertPrice = menuPrice / 5;
  18.         double totalPrice = menuPrice + dessertPrice + delivery;
  19.        
  20.         System.out.println(totalPrice);
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement