Advertisement
Sim0o0na

01. Programming Book

Apr 30th, 2018
1,345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.87 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Exam
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double pricePerPage = double.Parse(Console.ReadLine());
  10.             double pricePerFrontPage = double.Parse(Console.ReadLine());
  11.             int discountPercent = int.Parse(Console.ReadLine());
  12.             double designerSalary = double.Parse(Console.ReadLine());
  13.             int teamSalaryPercent = int.Parse(Console.ReadLine());
  14.  
  15.             double bookPrice = pricePerPage * 899 + pricePerFrontPage * 2;
  16.             double afterDiscount = bookPrice - bookPrice * (double)discountPercent / 100;
  17.             double finalSum = afterDiscount + designerSalary;
  18.             double finalPriceToPay = finalSum - finalSum * (double)teamSalaryPercent / 100;
  19.  
  20.             Console.WriteLine($"Avtonom should pay {finalPriceToPay:f2} BGN.");
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement