Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class BlagotvoritelnaKampaniq {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int days = Integer.parseInt(scan.nextLine());
- int numOfBakers = Integer.parseInt(scan.nextLine());
- int numOfCakes = Integer.parseInt(scan.nextLine());
- int numOfWaffles = Integer.parseInt(scan.nextLine());
- int numOfPancakes = Integer.parseInt(scan.nextLine());
- double cakesPrice = numOfCakes * 45;
- double wafflesPrice = numOfWaffles * 5.80;
- double pancakesPrice = numOfPancakes * 3.20;
- double priceForOneDay = (cakesPrice + wafflesPrice + pancakesPrice) * numOfBakers;
- double priceForWholeCharity = priceForOneDay * days;
- double finalPrice = priceForWholeCharity - (priceForWholeCharity/8);
- System.out.printf("%.2f" , finalPrice);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement