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 days = double.Parse(Console.ReadLine());
- var type = Console.ReadLine().ToLower();
- var evaluation = Console.ReadLine().ToLower();
- double price = 0;
- if (days < 10)
- {
- if (type == "room for one person")
- {
- price = days * 18;
- }
- else if (type == "apartment")
- {
- price = (days - 1) * 25 * 0.70;
- }
- else if (type == "president apartment")
- {
- price = (days - 1) * 35 * 0.90;
- }
- }
- else if (days >= 10 && days <= 15)
- {
- if (type == "room for one person")
- {
- price = (days - 1) * 18;
- }
- else if (type == "apartment")
- {
- price = (days - 1) * 25 * 0.65;
- }
- else if (type == "president apartment")
- {
- price = (days - 1) * 35 * 0.85;
- }
- }
- else if (days >= 15)
- {
- if (type == "room for one person")
- {
- price = (days-1) * 18;
- }
- else if (type == "apartment")
- {
- price = (days - 1) * 25 * 0.50;
- }
- else if (type == "president apartment")
- {
- price = (days - 1) * 35 * 0.80;
- }
- }
- if (evaluation == "positive")
- {
- price = price + (price * 0.25);
- }
- if (evaluation == "negative")
- {
- price = price - (price * 0.10);
- }
- Console.WriteLine($"{price:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment