Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Food {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double chicken = 10.35;
- double fish = 12.40;
- double vegeranian = 8.15;
- int chickenMeal = Integer.parseInt(scanner.nextLine());
- int fishMeal = Integer.parseInt(scanner.nextLine());
- int vegetarianMeal = Integer.parseInt(scanner.nextLine());
- double chickenPrice = chickenMeal * chicken;
- double fishPrice = fishMeal * fish;
- double vegetarianPrice = vegetarianMeal * vegeranian;
- double allPrice = chickenPrice + fishPrice + vegetarianPrice;
- double discount = allPrice * 0.20;
- double delivery = 2.50;
- double Price = discount + allPrice + delivery;
- System.out.printf("Total: %.2f",Price);
- }
- }
Add Comment
Please, Sign In to add comment