silvana1303

movie profit

Apr 30th, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. using System;
  2.  
  3. namespace exampreparation
  4. {
  5.     class exam
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string movie = 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 ticketProfit = tickets * ticketPrice;
  16.             double periodProfit = days * ticketProfit;
  17.             double fullProfit = periodProfit - (periodProfit * percent / 100);
  18.  
  19.             Console.WriteLine($"The profit from the movie {movie} is {fullProfit:f2} lv.");
  20.  
  21.         }
  22.     }
  23. }
Add Comment
Please, Sign In to add comment