desislava_topuzakova

05. Supplies for School

Sep 12th, 2021
1,121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. using System;
  2.  
  3. namespace SchoolSupplies
  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.             int litersPrep = int.Parse(Console.ReadLine());
  12.             int percent = int.Parse(Console.ReadLine());
  13.  
  14.             double pricePens = countPens * 5.80;
  15.             double priceMarkers = countMarkers * 7.20;
  16.             double pricePrep = litersPrep * 1.20;
  17.  
  18.             double sum = pricePens + priceMarkers + pricePrep;
  19.  
  20.             sum = sum - (percent / 100.0) * sum;
  21.  
  22.             Console.WriteLine(sum);
  23.  
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment