Advertisement
marking2112

StadiumIncome

Oct 13th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.81 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace LabExercises
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int sectorsNumber = int.Parse(Console.ReadLine());
  14.             int capacity = int.Parse(Console.ReadLine());
  15.             double ticketPrice = double.Parse(Console.ReadLine());
  16.  
  17.             double oneSectorIncome = (capacity * ticketPrice) / sectorsNumber;
  18.             double totalIncome = oneSectorIncome * sectorsNumber;
  19.  
  20.             double charity = (totalIncome - (oneSectorIncome * 0.75)) / 8;
  21.  
  22.             Console.WriteLine("Total income - {0:F2} BGN", totalIncome);
  23.             Console.WriteLine("Money for charity - {0:F2} BGN", charity);
  24.          
  25.  
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement