daily pastebin goal
44%
SHARE
TWEET

Alcohol Market

a guest Sep 14th, 2018 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class AlcoholMarket {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         double whisky = Double.parseDouble(scanner.nextLine());
  8.         double beer = Double.parseDouble(scanner.nextLine());
  9.         double wine = Double.parseDouble(scanner.nextLine());
  10.         double rakia = Double.parseDouble(scanner.nextLine());
  11.         double whiskyinLitres = Double.parseDouble(scanner.nextLine());
  12.  
  13.         double priceOfRakia = 25;
  14.         double priceOfWineInLitres = priceOfRakia - (0.4 * priceOfRakia);
  15.         double priceOfBeerInLitres = priceOfRakia - (0.8 * priceOfRakia);
  16.         double sumOfRakia = rakia * priceOfRakia;
  17.         double sumOfWine = wine * priceOfWineInLitres;
  18.         double sumOfBeer = priceOfBeerInLitres * beer;
  19.         double sumOfWhisky = whiskyinLitres * whisky;
  20.         double sumOfAll = sumOfRakia + sumOfWine + sumOfBeer + sumOfWhisky;
  21.  
  22.         System.out.printf("%.2f", sumOfAll);
  23.     }
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top