Advertisement
tsvetelinapasheva

TsvetelinaPasheva/FirstStepInCodingExercise/06.CharityCampraign

Jan 10th, 2021
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.99 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _06.CharityCampaign
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int daysNum = int.Parse(Console.ReadLine());
  10.             int bakers = int.Parse(Console.ReadLine());
  11.             int cakeNum = int.Parse(Console.ReadLine());
  12.             int wafflesNum = int.Parse(Console.ReadLine());
  13.             int pancakesNum = int.Parse(Console.ReadLine());
  14.  
  15.             int cakesPrice = 45;
  16.             double wafflesPrice = 5.80;
  17.             double pancakesPrice = 3.20;
  18.  
  19.             double cakesPricePerDay = cakeNum * cakesPrice;
  20.             double wafflesPricePerDay = wafflesNum * wafflesPrice;
  21.             double pancakesPricePerDay = pancakesNum * pancakesPrice;
  22.             double sumPerDay = (cakesPricePerDay + wafflesPricePerDay + pancakesPricePerDay) * bakers;
  23.             double endSum = sumPerDay * daysNum;
  24.             double sumAfter = endSum - (endSum/8);
  25.             Console.WriteLine(sumAfter);
  26.  
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement