Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace tESt
- {
- class Program
- {
- static void Main(string[] args)
- {
- var lenghtContract = Console.ReadLine().ToLower(); // “one”, или “two”
- var typeContract = Console.ReadLine().ToLower(); // Small”, “Middle”, “Large”или “ExtraLarge”;
- var internet = Console.ReadLine().ToLower(); // “yes”, или “no” интернет
- var months = int.Parse(Console.ReadLine()); // месеци за плащане
- double totalSum = 0;
- if (lenghtContract == "one")
- {
- if (typeContract == "small")
- {
- totalSum = 9.98;
- }
- else if (typeContract == "middle")
- {
- totalSum = 18.99;
- }
- else if (typeContract == "large")
- {
- totalSum = 25.98;
- }
- else if (typeContract == "extralarge")
- {
- totalSum = 35.99;
- }
- }
- else if (lenghtContract == "two")
- {
- if (typeContract == "small")
- {
- totalSum = 8.58;
- }
- else if (typeContract == "middle")
- {
- totalSum = 17.09;
- }
- else if (typeContract == "large")
- {
- totalSum = 23.59;
- }
- else if (typeContract == "extralarge")
- {
- totalSum = 31.79;
- }
- }
- if (internet == "yes")
- {
- if (totalSum <= 10)
- {
- totalSum = totalSum + 5.50;
- }
- else if (totalSum <= 30)
- {
- totalSum = totalSum + 4.35;
- }
- else if (totalSum > 30)
- {
- totalSum = totalSum + 3.85;
- }
- if (lenghtContract == "two")
- {
- totalSum = totalSum * 0.9625;
- }
- }
- else
- {
- if(lenghtContract == "two")
- {
- totalSum = totalSum * 0.9625;
- }
- }
- var finalSum = totalSum * months;
- Console.WriteLine($"{finalSum:f2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment