galinyotsev123

ProgBasicsExam3and4November2018-E01weddingTime

Dec 30th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class E01weddingTime {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. double whiskeyPrice = Double.parseDouble(scanner.nextLine());
  8. double waterLitre = Double.parseDouble(scanner.nextLine());
  9. double wineLitre = Double.parseDouble(scanner.nextLine());
  10. double champanueLitre = Double.parseDouble(scanner.nextLine());
  11. double whiskeyLitre = Double.parseDouble(scanner.nextLine());
  12.  
  13. double champanuePrice = whiskeyPrice * 0.50;
  14. double winePrice = champanuePrice * 0.40;
  15. double waterPrice = champanuePrice * 0.10;
  16.  
  17. double TotalWhiskey = whiskeyLitre * whiskeyPrice;
  18. double TotalChampanue = champanueLitre *champanuePrice;
  19. double TotalWater = waterLitre *waterPrice;
  20. double TotalWine = wineLitre *winePrice;
  21.  
  22. double Bill = TotalChampanue + TotalWater + TotalWhiskey + TotalWine;
  23.  
  24. System.out.printf("%.2f", Bill);
  25.  
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment