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 vacantion
- {
- class Program
- {
- static void Main(string[] args)
- {
- var old = int.Parse(Console.ReadLine());
- var junior = int.Parse(Console.ReadLine());
- var nights = int.Parse(Console.ReadLine());
- var transport = Console.ReadLine();
- var oldprice = 0.00;
- var juniorprice = 0.00;
- var allgroup = old + junior;
- var priceallgroupnight = 82.99;
- switch (transport)
- {
- case "train":
- if (allgroup >= 50)
- {
- oldprice = 24.99 * 0.50;
- juniorprice = 14.99 * 0.50;
- }
- else
- {
- oldprice = 24.99;
- juniorprice = 14.99;
- }
- break;
- case "bus":
- oldprice = 32.50;
- juniorprice = 28.50;
- break;
- case "boat":
- oldprice = 42.99;
- juniorprice = 39.99;
- break;
- case "airplane":
- oldprice = 70.00;
- juniorprice = 50.00;
- break;
- }
- var transportoneside = oldprice * oldprice + junior * juniorprice;
- var transporttwoside = transportoneside * 2;
- var pricepernight = nights * priceallgroupnight;
- var komisionna = (transporttwoside + pricepernight) * 0.10;
- var allsum = transporttwoside + pricepernight + komisionna;
- Console.WriteLine("{0:F2}", allsum);
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment