Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class BlagotvoritelnaKampaniq {
  4. public static void main(String[] args) {
  5. Scanner scan = new Scanner(System.in);
  6. int days = Integer.parseInt(scan.nextLine());
  7. int numOfBakers = Integer.parseInt(scan.nextLine());
  8. int numOfCakes = Integer.parseInt(scan.nextLine());
  9. int numOfWaffles = Integer.parseInt(scan.nextLine());
  10. int numOfPancakes = Integer.parseInt(scan.nextLine());
  11. double cakesPrice = numOfCakes * 45;
  12. double wafflesPrice = numOfWaffles * 5.80;
  13. double pancakesPrice = numOfPancakes * 3.20;
  14. double priceForOneDay = (cakesPrice + wafflesPrice + pancakesPrice) * numOfBakers;
  15. double priceForWholeCharity = priceForOneDay * days;
  16. double finalPrice = priceForWholeCharity - (priceForWholeCharity/8);
  17. System.out.printf("%.2f" , finalPrice);
  18.  
  19.  
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement