Advertisement
sanyakasarova

01. Movie Profit

Oct 23rd, 2021
731
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Loops
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string movieName = Console.ReadLine();
  10.             int days = int.Parse(Console.ReadLine());
  11.             int numOfTickets = int.Parse(Console.ReadLine());
  12.             double ticketPrice = double.Parse(Console.ReadLine());
  13.             int cinemaPercent = int.Parse(Console.ReadLine()); // 7
  14.  
  15.  
  16.             double totalIncome = days * numOfTickets * ticketPrice;
  17.  
  18.             double cinemaIncome = totalIncome * ((double)cinemaPercent / 100);
  19.  
  20.             double studioIncome = totalIncome - cinemaIncome;
  21.  
  22.             Console.WriteLine($"The profit from the movie {movieName} is {studioIncome:f2} lv.");
  23.  
  24.         }
  25.     }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement