Advertisement
Spocoman

Easter Bakery

Nov 27th, 2021
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.81 KB | None | 0 0
  1. using System;
  2.  
  3. namespace EasterBakery
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double flourKg = double.Parse(Console.ReadLine());
  10.             double flourPrice = double.Parse(Console.ReadLine());
  11.             double sugarKg = double.Parse(Console.ReadLine());
  12.             double eggPack = double.Parse(Console.ReadLine());
  13.             double yeast = double.Parse(Console.ReadLine());
  14.  
  15.             double flourTotal = flourKg * flourPrice;
  16.             double sugarTotal = flourKg * sugarKg * 0.75;
  17.             double eggPackTotal = flourKg * eggPack * 1.1;
  18.             double yeastTotal = flourKg * 0.75 * yeast * 0.2;
  19.             double sum = flourTotal + sugarTotal + eggPackTotal + yeastTotal;
  20.  
  21.             Console.WriteLine($"{sum:F2}");
  22.         }
  23.     }
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement