Advertisement
Guest User

06. Charity Campaign

a guest
Apr 20th, 2019
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp1
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int numberOfDays = int.Parse(Console.ReadLine());
  10.             int numberofBakers = int.Parse(Console.ReadLine());
  11.             int numberofCakes = int.Parse(Console.ReadLine());
  12.             int numberofWaffles = int.Parse(Console.ReadLine());
  13.             int numberofPancakes = int.Parse(Console.ReadLine());
  14.  
  15.             double productionofCakes = numberOfDays * numberofBakers * numberofCakes * 45;
  16.             double productionofWaffles = numberOfDays * numberofBakers * numberofWaffles * 5.80;
  17.             double productionofPancakes = numberOfDays * numberofBakers * numberofPancakes * 3.20;
  18.  
  19.             double productionAll = productionofCakes + productionofWaffles + productionofPancakes;
  20.             double moneySaved = 0.875 * productionAll;
  21.  
  22.             Console.WriteLine($"{ moneySaved:F2}");
  23.  
  24.  
  25.  
  26.  
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement