Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class GrapeAndRakia {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- double area = Double.parseDouble(scan.nextLine());
- double kgFromM = Double.parseDouble(scan.nextLine());
- double rejection = Double.parseDouble(scan.nextLine());
- double grapes = area * kgFromM ;
- double totalGrapes = grapes - rejection;
- double forRakia = totalGrapes * 0.45;
- double forSale = totalGrapes * 0.55;
- double rakiaInLiters = forRakia / 7.5;
- double moneyFromRakia = rakiaInLiters * 9.80;
- double moneyFromSale = forSale * 1.50;
- System.out.printf("%.2f%n", moneyFromRakia);
- System.out.printf("%.2f", moneyFromSale);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement