Advertisement
VladoG

PB-BG-Oct2018-ExamPrep-01.StadiumIncome

Nov 24th, 2018
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _01.StadiumIncome
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int sectorNum = int.Parse(Console.ReadLine());
  10.             int stadiumCapacity = int.Parse(Console.ReadLine());
  11.             double ticketPrice = double.Parse(Console.ReadLine());
  12.             double totalIncome = 0.0;
  13.             double charity = 0.0;
  14.             double sectorIncome = 0.0;
  15.  
  16.             totalIncome = stadiumCapacity * ticketPrice;
  17.             sectorIncome = totalIncome / sectorNum;
  18.             charity = (totalIncome - (0.75 * sectorIncome)) / 8.0;
  19.  
  20.             Console.WriteLine($"Total income - {totalIncome:F2} BGN");
  21.             Console.WriteLine($"Money for charity - {charity:F2} BGN");
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement