Advertisement
Guest User

Charity Campaign

a guest
Jun 12th, 2020
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.86 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class CharityCampaign2 {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.         int campaignDays = Integer.parseInt(scan.nextLine());
  7.         int pastryCooker = Integer.parseInt(scan.nextLine());
  8.         int cakes = Integer.parseInt(scan.nextLine());
  9.         int waffles = Integer.parseInt(scan.nextLine());
  10.         int pancakes = Integer.parseInt(scan.nextLine());
  11.  
  12.         int cakesIncome = cakes * 45;
  13.         double wafflesIncome = waffles * 5.8;
  14.         double pancakesIncome = pancakes * 3.2;
  15.         double totalIncomePerDay = (cakesIncome + wafflesIncome + pancakesIncome) * pastryCooker;
  16.         double totalIncome = totalIncomePerDay * campaignDays;
  17.         double incomeAfterTaxes = totalIncome - (totalIncome / 8);
  18.         System.out.println(incomeAfterTaxes);
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement