Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _03._Mobile_operator
- {
- class Program
- {
- static void Main(string[] args)
- {
- string contractExpire = Console.ReadLine();
- string contractType = Console.ReadLine();
- string mobileInternet = Console.ReadLine();
- int months = int.Parse(Console.ReadLine());
- double price = 0;
- switch (contractType)
- {
- case "Small":
- if (contractExpire == "one")
- {
- price = 9.98;
- }
- else
- {
- price = 8.58;
- }
- break;
- case "Middle":
- if (contractExpire == "one")
- {
- price = 18.99;
- }
- else
- {
- price = 17.09;
- }
- break;
- case "Large":
- if (contractExpire == "one")
- {
- price = 25.98;
- }
- else
- {
- price = 23.59;
- }
- break;
- case "ExtraLarge":
- if (contractExpire == "one")
- {
- price = 35.99;
- }
- else
- {
- price = 31.79;
- }
- break;
- }
- switch (mobileInternet)
- {
- case "yes":
- if (price <= 10)
- {
- price += 5.50;
- }
- else if (price > 10 && price <= 30)
- {
- price += 4.35;
- }
- else
- {
- price += 3.85;
- }
- break;
- }
- double totalPrice = price * months;
- if (contractExpire == "two" )
- {
- totalPrice *= 0.9625;
- Console.WriteLine($"{totalPrice:f2} lv.");
- }
- else
- {
- Console.WriteLine($"{totalPrice:f2} lv.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement