Advertisement
Dido09

01. ChristmasSweets

Nov 1st, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Quiz {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. double baklavaPerKg = Double.parseDouble(scanner.nextLine());
  8. double muffinsPerKg = Double.parseDouble(scanner.nextLine());
  9. double stollenKg = Double.parseDouble(scanner.nextLine());
  10. double candiesKg = Double.parseDouble(scanner.nextLine());
  11. double biscuitsKg = Double.parseDouble(scanner.nextLine());
  12.  
  13. double totalStollenPrice = stollenKg * (baklavaPerKg * 1.6);
  14. double totalCandyPrice = candiesKg * (muffinsPerKg * 1.8);
  15. double biscuitsTotal = biscuitsKg * 7.50;
  16.  
  17. double totalPrice = totalStollenPrice + totalCandyPrice + biscuitsTotal;
  18. System.out.printf("%.2f",totalPrice);
  19.  
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement