Advertisement
pavsavov

Rakia

Mar 21st, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class u1 {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. double area = Double.parseDouble(scanner.nextLine());
  8. double kgGrape = Double.parseDouble(scanner.nextLine());
  9. double badGrapeKg = Double.parseDouble(scanner.nextLine());
  10.  
  11.  
  12. double totalGrape = (area * kgGrape) - badGrapeKg;
  13. double grapeforRakia = totalGrape*0.45;
  14. double rakiaProfit =(((totalGrape*0.45) / 7.50) * 9.80);
  15. double grapeProfit = ((totalGrape - grapeforRakia) * 1.50);
  16.  
  17.  
  18. System.out.printf("%.2f%n", rakiaProfit);
  19.  
  20. System.out.printf("%.2f", grapeProfit);
  21.  
  22.  
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement