Advertisement
Lyubohd

Untitled

Jun 24th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class GrapeAndRakia {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.  
  7.         double area = Double.parseDouble(scan.nextLine());
  8.         double kgFromM = Double.parseDouble(scan.nextLine());
  9.         double rejection = Double.parseDouble(scan.nextLine());
  10.  
  11.         double grapes = area * kgFromM ;
  12.         double totalGrapes = grapes - rejection;
  13.  
  14.         double forRakia = totalGrapes * 0.45;
  15.         double forSale = totalGrapes * 0.55;
  16.  
  17.         double rakiaInLiters = forRakia / 7.5;
  18.  
  19.         double moneyFromRakia = rakiaInLiters * 9.80;
  20.         double moneyFromSale = forSale * 1.50;
  21.  
  22.         System.out.printf("%.2f%n", moneyFromRakia);
  23.         System.out.printf("%.2f", moneyFromSale);
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement