Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Baba Tinche Airlines
- //Every month Baba Tinche travels to the Republic of Tajikistan to meet her boyfriend. But the tickets are so expensive that she //decides to establish her own airline instead called Baba Tinche Airlines. There are three travel classes in Baba Tinche Airlines:
- //• First Class which accommodates 12 passengers. The ticket price is $7000.
- //• Business Class which accommodates 28 passengers. The ticket price is $3500.
- //• Economy Class which accommodates 50 passengers. The ticket price is $1000.
- //Please note that some passengers are Frequent Flyers and their tickets are 70% off ($1000 ticket will cost $300). Also some //passengers purchase a meal on the flight, which costs 0.5% of the ticket price for the travel class they are in. Please help //Baba //Tinche calculate her income and calculate the difference between her income and the maximum possible income (the maximum //possible //income being all seats taken, no Frequent Flyers and everyone purchasing meals). You will be given the number of //passengers for //each class, the number of passengers who are Frequent Flyers in that class, and the number of passengers who //purchase a meal in //that class.
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication3
- {
- class Program
- {
- static void Main(string[] args)
- {
- string input1 = Console.ReadLine();
- string[] line1 = input1.Split(' ');
- int firstClass = Convert.ToInt32(line1[0]);
- int FiCnumOfFF = Convert.ToInt32(line1[1]);
- int FCMeal = Convert.ToInt32(line1[2]);
- int cost1 = ((firstClass - FiCnumOfFF) * 7000) + (FiCnumOfFF * 2100) + (FCMeal * 35);
- int maxCost1 = (12 * 7000) + (12 * 35);
- string input2 = Console.ReadLine();
- string[] line2 = input2.Split(' ');
- int bussinessClass = Convert.ToInt32(line2[0]);
- int BussCnumOfFF = Convert.ToInt32(line2[1]);
- int BussCMeal = Convert.ToInt32(line2[2]);
- int cost2 = ((bussinessClass - BussCnumOfFF) * 3500) + (BussCnumOfFF * 1050) + (BussCMeal * 35/2);
- int maxCost2 = (28 * 3500) + (28 * 35/2);
- string input3 = Console.ReadLine();
- string[] line3 = input3.Split(' ');
- int economyClass = Convert.ToInt32(line3[0]);
- int EcClnumOfFF = Convert.ToInt32(line3[1]);
- int EcClMeal = Convert.ToInt32(line3[2]);
- int cost3 = ((economyClass - EcClnumOfFF) * 1000) + (EcClnumOfFF * 300) + (EcClMeal * 5);
- int maxCost3 = (50 * 1000) + (50 * 5);
- int sum = cost1 + cost2 + cost3;
- int maxSum = maxCost1 + maxCost2 + maxCost3;
- Console.WriteLine(sum);
- Console.WriteLine(maxSum - sum);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement