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 Hotelska_staq
- {
- class Program
- {
- static void Main(string[] args)
- {
- string month = Console.ReadLine(); ;
- int days = int.Parse(Console.ReadLine());
- double priceS;
- double priceA;
- double wholePs;
- double wholePa;
- if (month == "May" || month == "October")
- {
- priceS = 50;
- priceA = 65;
- if (days > 7 && days < 14) //// не >=, а >
- {
- priceS = priceS - (priceS * 5 / 100);
- wholePs = priceS * days;
- wholePa = priceA * days;
- Console.WriteLine("Apartment: {0:f2} lv.", wholePa);
- Console.WriteLine("Studio: {0:f2} lv.", wholePs);
- }
- else if (days >= 14)
- {
- priceS = priceS - (priceS * 30 / 100);
- priceA = priceA - (priceA * 10 / 100);
- wholePs = priceS * days;
- wholePa = priceA * days;
- Console.WriteLine("Apartment: {0:f2} lv.", wholePa);
- Console.WriteLine("Studio: {0:f2} lv.", wholePs);
- }
- else
- {
- wholePs = priceS * days;
- wholePa = priceA * days;
- Console.WriteLine("Apartment: {0:f2} lv.", wholePa);
- Console.WriteLine("Studio: {0:f2} lv.", wholePs);
- }
- }
- if (month == "June" || month == "September")
- {
- priceS = 75.20;
- priceA = 68.70;
- if (days > 14) ///// повече от 14!!!!!!!!!
- {
- priceS = priceS - (priceS * 20 / 100);
- priceA = priceA - (priceA * 10 / 100);
- wholePs = priceS * days;
- wholePa = priceA * days;
- Console.WriteLine("Apartment: {0:f2} lv.", wholePa);
- Console.WriteLine("Studio: {0:f2} lv.", wholePs);
- }
- else
- {
- wholePs = priceS * days;
- wholePa = priceA * days;
- Console.WriteLine("Apartment: {0:f2} lv.", wholePa);
- Console.WriteLine("Studio: {0:f2} lv.", wholePs);
- }
- }
- if (month == "July" || month == "August")
- {
- priceS = 76;
- priceA = 77;
- if (days > 14) /// повече от 14
- {
- priceA = priceA - (priceA * 10 / 100);
- wholePs = priceS * days;
- wholePa = priceA * days;
- Console.WriteLine("Apartment: {0:f2} lv.", wholePa);
- Console.WriteLine("Studio: {0:f2} lv.", wholePs);
- }
- else
- {
- wholePs = priceS * days;
- wholePa = priceA * days;
- Console.WriteLine("Apartment: {0:f2} lv.", wholePa);
- Console.WriteLine("Studio: {0:f2} lv.", wholePs);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement