Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Project1
- {
- class Program
- {
- static void Main(string[] args)
- {
- var siniors = int.Parse(Console.ReadLine());
- var students = int.Parse(Console.ReadLine());
- var nights = int.Parse(Console.ReadLine());
- string transport = Console.ReadLine();
- var siniorTax = 0.00;
- var studentsTax = 0.00;
- switch (transport)
- {
- case "train":
- siniorTax = 24.99;
- studentsTax = 14.99;
- if (siniors + students >= 50)
- {
- siniorTax = 24.99 * 0.75;
- studentsTax =14.99 * 0.75;
- }
- else
- {
- siniorTax = 24.99;
- studentsTax = 14.99;
- }
- break;
- case "bus":
- siniorTax = 32.50;
- studentsTax = 28.50;
- break;
- case "ship":
- siniorTax = 42.99;
- studentsTax = 39.99;
- break;
- case "plane":
- siniorTax = 70.00;
- studentsTax = 50.00;
- break;
- }
- var transportRazhod = siniors * siniorTax + students * studentsTax;
- var hotel = nights * 82.99;
- var commisiona = (transportRazhod + hotel) * 0.10;
- var summ = transportRazhod + hotel + commisiona;
- Console.WriteLine("{0:f2}", summ);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement