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