Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class E01weddingTime {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double whiskeyPrice = Double.parseDouble(scanner.nextLine());
- double waterLitre = Double.parseDouble(scanner.nextLine());
- double wineLitre = Double.parseDouble(scanner.nextLine());
- double champanueLitre = Double.parseDouble(scanner.nextLine());
- double whiskeyLitre = Double.parseDouble(scanner.nextLine());
- double champanuePrice = whiskeyPrice * 0.50;
- double winePrice = champanuePrice * 0.40;
- double waterPrice = champanuePrice * 0.10;
- double TotalWhiskey = whiskeyLitre * whiskeyPrice;
- double TotalChampanue = champanueLitre *champanuePrice;
- double TotalWater = waterLitre *waterPrice;
- double TotalWine = wineLitre *winePrice;
- double Bill = TotalChampanue + TotalWater + TotalWhiskey + TotalWine;
- System.out.printf("%.2f", Bill);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment