Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Quiz {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double baklavaPerKg = Double.parseDouble(scanner.nextLine());
- double muffinsPerKg = Double.parseDouble(scanner.nextLine());
- double stollenKg = Double.parseDouble(scanner.nextLine());
- double candiesKg = Double.parseDouble(scanner.nextLine());
- double biscuitsKg = Double.parseDouble(scanner.nextLine());
- double totalStollenPrice = stollenKg * (baklavaPerKg * 1.6);
- double totalCandyPrice = candiesKg * (muffinsPerKg * 1.8);
- double biscuitsTotal = biscuitsKg * 7.50;
- double totalPrice = totalStollenPrice + totalCandyPrice + biscuitsTotal;
- System.out.printf("%.2f",totalPrice);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement