Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class AlcoholMarket {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- double whiskeyPrice = Double.parseDouble(scan.nextLine());
- double beer = Double.parseDouble(scan.nextLine());
- double whine = Double.parseDouble(scan.nextLine());
- double rakiq = Double.parseDouble(scan.nextLine());
- double whiskey = Double.parseDouble(scan.nextLine());
- double rakiqPrice = whiskeyPrice - (whiskeyPrice * 0.5);
- double whinePrice = rakiqPrice - (rakiqPrice * 0.4);
- double beerPrice = rakiqPrice - (rakiqPrice * 0.8);
- double rakiqSum = rakiq * rakiqPrice;
- double beerSum = beer * beerPrice;
- double whineSum = whine * whinePrice;
- double whiskeySum = whiskey * whiskeyPrice;
- double finalPrice = rakiqSum + beerSum + whineSum + whiskeySum;
- System.out.printf("%.2f", finalPrice);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement