Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Security.Cryptography.X509Certificates;
- using System.Text;
- using System.Threading.Tasks;
- namespace _05
- {
- class Program
- {
- static void Main(string[] args)
- {
- //1. входни данни
- int countNights = int.Parse(Console.ReadLine());
- string destination = Console.ReadLine(); // "Colorado", "Alps" и "Andie"
- string roomType = Console.ReadLine(); // "double room" или "apartment"
- double pricePerNight = 0; //цена за 1 нощувка (зависи от дестинация и вид на стаята)
- if (destination == "Colorado" && roomType == "double room")
- {
- pricePerNight = 38;
- }
- else if (destination == "Colorado" && roomType == "apartment")
- {
- pricePerNight = 45;
- }
- else if (destination == "Alps" && roomType == "double room")
- {
- pricePerNight = 35;
- }
- else if (destination == "Alps" && roomType == "apartment")
- {
- pricePerNight = 42;
- }
- else if (destination == "Andie" && roomType == "double room")
- {
- pricePerNight = 39;
- }
- else if (destination == "Andie" && roomType == "apartment")
- {
- pricePerNight = 49;
- }
- //сума за почивка = брой на нощувки * цена за 1 нощувка
- double totalPrice = countNights * pricePerNight;
- Console.WriteLine($"They have to spend {totalPrice:F2} leva.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment