Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _02._Odd_Occurrences
- {
- class Program
- {
- static void Main(string[] args)
- {
- string years = Console.ReadLine(); //"one", или "two"
- string type = Console.ReadLine(); //"Small", "Middle", "Large"или "ExtraLarge"
- string hasInternet = Console.ReadLine(); //yes no
- int months = int.Parse(Console.ReadLine());
- //1. ЦЕНА ЗА ДОГОВОР -> ГОДИНИТЕ И ОТ ТИП
- //2. ПРОВЕРКА ЗА ИНТЕРНЕТА
- //3. доп. отстъпка за 2 год
- //4. ИЗЧИСЛЯВАМЕ ОБЩАТА СУМА
- double priceContract = 0;
- if (years == "one")
- {
- //проверка за типа
- switch (type)
- {
- case "Small":
- priceContract = 9.98;
- break;
- case "Middle":
- priceContract = 18.99;
- break;
- case "Large":
- priceContract = 25.98;
- break;
- case "ExtraLarge":
- priceContract = 35.99;
- break;
- }
- }
- else if (years == "two")
- {
- switch (type)
- {
- case "Small":
- priceContract = 8.58;
- break;
- case "Middle":
- priceContract = 17.09;
- break;
- case "Large":
- priceContract = 23.59;
- break;
- case "ExtraLarge":
- priceContract = 31.79;
- break;
- }
- }
- if (hasInternet == "yes")
- {
- //o при такса по-малка или равна на 10.00 лв. 5.50 лв.
- // o при такса по-малка или равна на 30.00 лв. 4.35 лв.
- //o при такса по-голяма от 30.00 лв. 3.85 лв.
- if (priceContract <= 10)
- {
- priceContract += 5.50;
- }
- else if (priceContract <= 30)
- {
- priceContract += 4.35;
- }
- else
- {
- priceContract += 3.85;
- }
- }
- if (years == "two")
- {
- priceContract -= priceContract * 0.0375;
- }
- //обща сума за месеците = бр.месеци по такса за 1 месец
- double totalSum = months * priceContract;
- Console.WriteLine($"{totalSum:F2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement