Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Exercise1002 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double priceofWhiskiinBGN = Double.parseDouble(scanner.nextLine());
- double BeerinLiters = Double.parseDouble(scanner.nextLine());
- double WineinLiters = Double.parseDouble(scanner.nextLine());
- double RakiainLiters = Double.parseDouble(scanner.nextLine());
- double WhiskeyinLiters = Double.parseDouble(scanner.nextLine());
- double priceofRakia = priceofWhiskiinBGN /2;
- double priceofBeer = priceofRakia -priceofRakia *0.8;
- double priceofWine =priceofRakia -priceofRakia * 0.4;
- double totalWiskyeprice = priceofWhiskiinBGN * WhiskeyinLiters;
- double totalrakiaprice = priceofRakia * RakiainLiters;
- double toralwineprice = priceofWine * WineinLiters;
- double totalbeerprice = priceofBeer * BeerinLiters;
- double total = totalWiskyeprice + toralwineprice + totalbeerprice + totalrakiaprice;
- System.out.printf("%.2f",total);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement