IvetValcheva

Supplies for School

Jan 10th, 2022
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _05._Supplies_for_School
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int pensCount = int.Parse(Console.ReadLine());
  10.             int markersCount = int.Parse(Console.ReadLine());
  11.             int preparationCount = int.Parse(Console.ReadLine());
  12.            
  13.             int percent = int.Parse(Console.ReadLine());
  14.  
  15.             double pensPrice = pensCount * 5.80;
  16.             double markersPrise = markersCount * 7.20;
  17.             double preparationPrice = preparationCount * 1.20;
  18.  
  19.             //обащата сума
  20.             double sum = pensPrice + markersPrise + preparationPrice;
  21.  
  22.             //от общата сума - изваждаме % намаление;
  23.             double totalSum = sum - sum * (percent / 100.0);
  24.  
  25.             //отпечатване на резултата
  26.             Console.WriteLine(totalSum);
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment