Advertisement
Spocoman

Agency Profit

Feb 16th, 2022
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | None | 0 0
  1. using System;
  2.  
  3. namespace AgencyProfit
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string agency = Console.ReadLine();
  10.             int ticket = int.Parse(Console.ReadLine());
  11.             int kidTicket = int.Parse(Console.ReadLine());
  12.             double ticketPrice = double.Parse(Console.ReadLine());
  13.             double service = double.Parse(Console.ReadLine());
  14.  
  15.             double totalAdult = (ticketPrice + service) * ticket;
  16.             double totalKid = (0.3 * ticketPrice + service) * kidTicket;
  17.             double total = (totalAdult + totalKid) / 5;
  18.  
  19.             Console.WriteLine($"The profit of your agency from {agency} tickets is {total:f2} lv.");
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement