Advertisement
Guest User

Untitled

a guest
Feb 29th, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.36 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Fishland
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string month = Console.ReadLine();
  10.             int spendHours = int.Parse(Console.ReadLine());
  11.             int people = int.Parse(Console.ReadLine());
  12.             string timeOfDay = Console.ReadLine();
  13.  
  14.             double price = 0;
  15.  
  16.             if (month == "march" || month == "april" || month == "may")
  17.             {
  18.                 if (timeOfDay == "day")
  19.                 {
  20.                     price = spendHours * people * 10.50;
  21.  
  22.                 }
  23.                 else if (timeOfDay == "night")
  24.                 {
  25.                     price = spendHours * people * 8.40;
  26.                 }
  27.             }
  28.  
  29.             else if (month == "jun" || month == "july" || month == "august")
  30.             {
  31.                 if (timeOfDay == "day")
  32.                 {
  33.                     price = spendHours * people * 12.60;
  34.  
  35.                 }
  36.                 else if (timeOfDay == "night")
  37.                 {
  38.                     price = spendHours * people * 10.20;
  39.                 }
  40.  
  41.  
  42.             }
  43.             if (people <= 5)
  44.             {
  45.                 price = price * 0.1;
  46.             }
  47.            
  48.                 Console.WriteLine($"Price per person for one hour: {price}");
  49.         }
  50.     }
  51. }
  52. //march
  53. //3
  54. //3
  55. //day
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement