Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _10.SkiTrip
- {
- class SkiTrip
- {
- static void Main(string[] args)
- {
- int days = int.Parse(Console.ReadLine());
- string roomType = Console.ReadLine();
- string feedback = Console.ReadLine();
- int nights = days - 1;
- double sumNights = 0;
- if (roomType == "room for one person")
- {
- sumNights = 18 * nights;
- }
- else if ( roomType == "apartment")
- {
- if (nights < 10)
- {
- sumNights = (25 * nights) * 0.7;
- }
- else if (nights >= 10 && nights <= 15)
- {
- sumNights = (25 * nights) * 0.65;
- }
- else if (nights > 15)
- {
- sumNights = (25 * nights) * 0.5;
- }
- }
- else if (roomType == "president apartment")
- {
- if (nights < 10)
- {
- sumNights = (35 * nights) * 0.9;
- }
- else if (nights >= 10 && nights <= 15)
- {
- sumNights = (35 * nights) * 0.85;
- }
- else if (nights > 15)
- {
- sumNights = (35 * nights) * 0.8;
- }
- }
- if (feedback == "positive")
- {
- sumNights = sumNights * 1.25; // *=
- }
- else if (feedback == "negative")
- {
- sumNights = sumNights * 0.9;
- }
- Console.WriteLine($"{sumNights:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement