Valantina

MovieProfit

Jun 18th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 KB | None | 0 0
  1. using System;
  2.  
  3. namespace MovieProfit
  4. {
  5.     class MovieProfit
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string movieName = Console.ReadLine();
  10.             int days = int.Parse(Console.ReadLine());
  11.             int tickets = int.Parse(Console.ReadLine());
  12.             double ticketPrice = double.Parse(Console.ReadLine());
  13.             int percent = int.Parse(Console.ReadLine());
  14.  
  15.             double profitForDay = tickets * ticketPrice; //печалба за 1 ден
  16.             double totalProfit = profitForDay * days; //печалба за всички дни
  17.             double profitForCinema = totalProfit * (percent / 100.0); //печалба за киното
  18.             double studioProfit = totalProfit - profitForCinema;//печалба за студиото
  19.  
  20.             Console.WriteLine($"The profit from the movie {movieName} is {studioProfit:F2} lv.");
  21.         }
  22.     }
  23. }
Add Comment
Please, Sign In to add comment