IvetValcheva

06. Repainting

Oct 31st, 2021
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.54 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Repainting
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             //Четем 4 реда от конзолата (3 материала + часове за работа)
  10.             int nylonQuantity = int.Parse(Console.ReadLine());
  11.             int paintQuantity = int.Parse(Console.ReadLine());
  12.             int thinnerLiters = int.Parse(Console.ReadLine());
  13.  
  14.             int workersHours = int.Parse(Console.ReadLine());
  15.  
  16.             //изчисляваме сумата на всеки един от материалите (общо 3)
  17.             double nylonPrice = (nylonQuantity+2) * 1.50;
  18.             double paintPrice = (paintQuantity + paintQuantity*0.1) * 14.50;
  19.             double thinnerPrice = thinnerLiters * 5.00;
  20.  
  21.  
  22.             //изчисляваме разходи за материали (общо 3 + цена за торбичка)
  23.             double materialsSum = nylonPrice + paintPrice + thinnerPrice + 0.40;
  24.  
  25.             //заплата на майстора (часове * 30% от разходи за материали)
  26.             double workersSum = (materialsSum * 0.3) * workersHours;
  27.  
  28.             //общо сумата от всички разходи (разходи за материали + заплата на майстора)
  29.             double totalSum = materialsSum + workersSum;
  30.  
  31.             //отпечатваме общата сумата от всички разходи
  32.             Console.WriteLine(totalSum);
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment