Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package EXAM;
- import java.util.Scanner;
- public class Lemonade_Stand_01 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double lemonsKg = Double.parseDouble(scanner.nextLine());
- double sugarKg = Double.parseDouble(scanner.nextLine());
- double waterLiters = Double.parseDouble(scanner.nextLine()) * 1000;
- double lemonJuice = lemonsKg * 980;
- double sugarPercent = sugarKg * 0.30;
- double allLemonJuice = lemonJuice + waterLiters + sugarPercent;
- double cupSold = Math.floor(allLemonJuice / 150);
- double money = cupSold * 1.20;
- System.out.printf("All cups sold: %.0f%n",cupSold);
- System.out.printf("Money earned: %.2f",money);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement