Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class CharityCampaign2 {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int campaignDays = Integer.parseInt(scan.nextLine());
- int pastryCooker = Integer.parseInt(scan.nextLine());
- int cakes = Integer.parseInt(scan.nextLine());
- int waffles = Integer.parseInt(scan.nextLine());
- int pancakes = Integer.parseInt(scan.nextLine());
- int cakesIncome = cakes * 45;
- double wafflesIncome = waffles * 5.8;
- double pancakesIncome = pancakes * 3.2;
- double totalIncomePerDay = (cakesIncome + wafflesIncome + pancakesIncome) * pastryCooker;
- double totalIncome = totalIncomePerDay * campaignDays;
- double incomeAfterTaxes = totalIncome - (totalIncome / 8);
- System.out.println(incomeAfterTaxes);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement