desislava_topuzakova

01. Food Delivery

Jul 18th, 2020
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.17 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO.IsolatedStorage;
  4. using System.Linq;
  5.  
  6. namespace _02._Odd_Occurrences
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             int countChickenMenu = int.Parse(Console.ReadLine()); //10.35
  13.             int countFishMenu = int.Parse(Console.ReadLine()); //12.40
  14.             int countVegetarianMenu = int.Parse(Console.ReadLine()); //8.15
  15.  
  16.             //Сума за менютата = сума от пилешки (бр. пил * 10.35)
  17.             //+ сума от рибешките (бр.риб * 12.40)
  18.             //+ сума от вегетарианските (бр. вег * 8.15)
  19.             double sumMenus = countChickenMenu * 10.35 + countFishMenu * 12.40 + countVegetarianMenu * 8.15;
  20.  
  21.             //десерт = 20 % от сумата за менютата
  22.             double dessertPrice = 0.2 * sumMenus;
  23.  
  24.             //обща сума = сума от менютата + цена за десерт + доставка
  25.             double totalSum = sumMenus + dessertPrice + 2.50;
  26.  
  27.             Console.WriteLine($"Total: {totalSum:F2}");
  28.         }
  29.     }
  30. }
Add Comment
Please, Sign In to add comment