Advertisement
Guest User

Charity Campaign

a guest
Apr 10th, 2020
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.19 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class CharityCampaign_06 {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.  
  8.         //.1 read input -> numberOfDays -> цяло число - int
  9.         //.2         -> numberOfSladkari -> цяло число - int
  10.         //3.         -> numbers -> cakes, gofretes, pancakes
  11.         //4. calculate TotalSumDay = 1/8
  12.         //5. print -> събраните пари от кампанията
  13.  
  14.  
  15.         int numberOfDays = Integer.parseInt(scanner.nextLine());
  16.         int numberOfSladkari = Integer.parseInt(scanner.nextLine());
  17.  
  18.         int numberOfCakes = Integer.parseInt(scanner.nextLine());
  19.         int numberOfGofretes = Integer.parseInt(scanner.nextLine());
  20.         int numberOfPancakes = Integer.parseInt(scanner.nextLine());
  21.  
  22.          int numberOfCakes = 14 * 45;
  23.          int numberOfGofretes = 30 * 5.80;
  24.          int numberOfPancakes = 16 * 3.20;
  25.  
  26.          double totalSumDay = (numberOfCakes + numberOfGofretes + numberOfPancakes ) * 8 ;
  27.          double total2 = totalSumDay * 20;
  28.          double totalALL = total2 - 1/8;
  29.  
  30.          System.out.printf("%.2f", totalALL);
  31.  
  32.  
  33.  
  34.     }
  35.  
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement