Advertisement
bilyana_popmihaylova

Untitled

Feb 12th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.80 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. class Main {
  4.   public static void main(String[] args) {
  5.   Scanner scanner = new Scanner(System.in);
  6.   double days = Double.parseDouble (scanner.nextLine());
  7.   int pastryCook = Integer.parseInt(scanner.nextLine());
  8.   double cakesQuantity = Double.parseDouble (scanner.nextLine());
  9.   double wafflesQuantity = Double.parseDouble (scanner.nextLine());
  10.   double pancakesQuantity = Double.parseDouble (scanner.nextLine());
  11.  
  12.   double cakesSum = (cakesQuantity * 45);
  13.   double wafflesSum = (wafflesQuantity * 5.80);
  14.   double pancakesSum = (pancakesQuantity * 3.20);
  15.  
  16.   double totalSum_1day = (cakesSum + wafflesSum + pancakesSum)*8;
  17.   double totalCampaign = (totalSum_1day * days);
  18.   double rest = totalCampaign - (1/8 * totalCampaign);
  19.  
  20.   System.out.printf("%.2f", rest);
  21.  
  22.  
  23.   }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement