Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double flourKg = Double.parseDouble(scanner.nextLine()),
- flourPrice = Double.parseDouble(scanner.nextLine()),
- sugarKg = Double.parseDouble(scanner.nextLine()),
- eggPack = Double.parseDouble(scanner.nextLine()),
- yeast = Double.parseDouble(scanner.nextLine()),
- flourTotal = flourKg * flourPrice,
- sugarTotal = flourKg * sugarKg * 0.75,
- eggPackTotal = flourKg * eggPack * 1.10,
- yeastTotal = flourKg * 0.75 * yeast * 0.20,
- totalSum = flourTotal + sugarTotal + eggPackTotal + yeastTotal;
- System.out.printf("%.2f\n", totalSum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement