Advertisement
Guest User

Untitled

a guest
May 20th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.00 KB | None | 0 0
  1. package Demos;
  2.  
  3. import java.time.LocalDate;
  4. import java.time.format.DateTimeFormatter;
  5. import java.util.Scanner;
  6.  
  7. public class DemoClass {
  8.     public static void main(String[] args) {
  9.         Scanner scan = new Scanner(System.in);
  10.  
  11.         int days = Integer.parseInt(scan.nextLine());
  12.         int bakers = Integer.parseInt(scan.nextLine());
  13.         int cakeCount = Integer.parseInt(scan.nextLine());
  14.         int waffleCount = Integer.parseInt(scan.nextLine());
  15.         int pancakeCount = Integer.parseInt(scan.nextLine());
  16.  
  17.         double cakePrice = 45;
  18.         double wafflePrice = 5.80;
  19.         double pancakePrice = 3.20;
  20.  
  21.         double cakesPerDay = cakeCount * cakePrice;
  22.         double wafflePerDay = waffleCount * wafflePrice;
  23.         double pancakePerDay = pancakeCount * pancakePrice;
  24.  
  25.         double dailySum = (cakesPerDay + wafflePerDay + pancakePerDay) * bakers;
  26.  
  27.         double totalSum = dailySum * days;
  28.  
  29.         System.out.printf("%.2f", totalSum - totalSum / 8);
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement