galinyotsev123

ProgBasicsExam22and23December2018-E01christmasSweets

Dec 30th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class E01christmasSweets {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. double baklavaPrice = Double.parseDouble(scanner.nextLine());
  8. double muffinPrice = Double.parseDouble(scanner.nextLine());
  9. double coockiesPrice = 7.50;
  10. double candysPrice = muffinPrice * 1.8;
  11. double shtolensPrice = baklavaPrice * 1.6;
  12.  
  13. double shtolens = Double.parseDouble(scanner.nextLine());
  14. double candys= Double.parseDouble(scanner.nextLine());
  15. double coockies = Double.parseDouble(scanner.nextLine());
  16.  
  17.  
  18. double total = (coockies * coockiesPrice) + (candys * candysPrice) + (shtolens * shtolensPrice);
  19.  
  20.  
  21. System.out.printf("%.2f", total);
  22.  
  23.  
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment