Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _02._Exam___Godzila_vs_King_Kong
- {
- class Program
- {
- static void Main(string[] args)
- {
- String month = Console.ReadLine();
- Double hours = double.Parse(Console.ReadLine());
- Double customers = Double.Parse(Console.ReadLine());
- string dayOrNight = Console.ReadLine();
- double dayMoneyCounter = 0;
- double nightMoneyCounter = 0;
- if (month =="march" || month == "april" || month == "may")
- {
- Double dayPrice = 10.50;
- Double nightPrice = 8.40;
- Double dayPriceTotal = dayPrice * hours * customers;
- Double nightPriceTotal = nightPrice * hours * customers;
- if (dayOrNight == "day")
- {
- dayMoneyCounter += dayPriceTotal;
- }
- else if (dayOrNight == "night")
- {
- nightMoneyCounter += nightPriceTotal;
- }
- if (customers >= 4)
- {
- dayMoneyCounter *= 0.9;
- nightMoneyCounter *= 0.9;
- }
- else if (hours >= 5)
- {
- dayMoneyCounter *= 0.5;
- nightMoneyCounter *= 0.5;
- }
- }
- if (month == "june" || month == "july" || month == "august")
- {
- Double dayPrice = 12.60;
- Double nightPrice = 10.20;
- Double dayPriceTotal = dayPrice * hours * customers;
- Double nightPriceTotal = nightPrice * hours * customers;
- if (dayOrNight == "day")
- {
- dayMoneyCounter += dayPriceTotal;
- }
- else if (dayOrNight == "night")
- {
- nightMoneyCounter += nightPriceTotal;
- }
- if (customers >= 4)
- {
- dayMoneyCounter *= 0.9;
- nightMoneyCounter *= 0.9;
- }
- if (hours >= 5)
- {
- dayMoneyCounter *= 0.5;
- nightMoneyCounter *= 0.5;
- }
- }
- Double pricePerPersonFor1Hourday = dayMoneyCounter / (hours * customers);
- Double pricePerPersonFor1Hournight = nightMoneyCounter / (hours * customers);
- if (dayOrNight == "day")
- {
- Console.WriteLine($"Price per person for one hour: {pricePerPersonFor1Hourday:f2}");
- Console.WriteLine($"Total cost of the visit: {dayMoneyCounter:f2}");
- }
- else if (dayOrNight == "night")
- {
- Console.WriteLine($"Price per person for one hour: {pricePerPersonFor1Hournight:f2}");
- Console.WriteLine($"Total cost of the visit: {nightMoneyCounter:f2}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement