desislava_topuzakova

01. Supplies for School

Mar 31st, 2020
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _01._Supplies_for_School
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int countPens = int.Parse(Console.ReadLine());
  10.             int countMarkers = int.Parse(Console.ReadLine());
  11.             double litersCleaner = double.Parse(Console.ReadLine());
  12.             int discount = int.Parse(Console.ReadLine());
  13.             //Пакет химикали - 5.80 лв
  14.             //Пакет маркери - 7.20 лв
  15.             //Препарат - 1.20 лв (за литър)
  16.             double pricePens = countPens * 5.80;
  17.             double priceMarkers = countMarkers * 7.20;
  18.             double priceCleaner = litersCleaner * 1.20;
  19.  
  20.             double totalPrice = pricePens + priceMarkers + priceCleaner;
  21.             double priceWithDiscount = totalPrice - (totalPrice * discount) / 100;
  22.  
  23.             Console.WriteLine($"{priceWithDiscount:f3}");
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment