Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp7
- {
- class Program
- {
- static void Main(string[] args)
- {
- string townName = Console.ReadLine();
- string packet = Console.ReadLine();
- string discount = Console.ReadLine();
- int days = int.Parse(Console.ReadLine());
- double price = 0;
- if(townName == "Bansko" || townName == "Borovets")
- {
- if(packet == "noEquipment" )
- {
- price = 80;
- if(discount == "yes")
- {
- price = price - (price * 0.1);
- }
- }
- else if (packet == "withEquipment")
- {
- price = 100;
- if (discount == "yes")
- {
- price = price - (price * 0.05);
- }
- else
- {
- Console.WriteLine("Invalid input!");
- }
- }
- }
- else if (townName == "Varna" || townName == "Burgas")
- {
- if (packet == "noBreakfast")
- {
- price = 100;
- if (discount == "yes")
- {
- price = price - (price * 0.07);
- }
- }
- else if (packet == "withBreakfast")
- {
- price = 130;
- if (discount == "yes")
- {
- price = price - (price * 0.12);
- }
- }
- else
- {
- Console.WriteLine("Invalid input!");
- }
- }
- else
- {
- Console.WriteLine("Invalid input!");
- }
- if(days > 7)
- {
- days -= 1;
- }
- double total = days * price;
- if (days < 1)
- {
- Console.WriteLine("Days must be positive number!");
- }
- else {
- Console.WriteLine($"The price is {total:f2}lv! Have a nice time!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement