Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Unknown
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Please enter number of people");
- int total = int.Parse(Console.ReadLine());
- Console.WriteLine("Please enter name of group: Student or Bisness or Regular");
- string peopleGroup = Console.ReadLine();
- Console.WriteLine("Please enter day of week: Friday or Saturday or Sunday");
- string weekDay = Console.ReadLine();
- decimal price = 0;
- if(peopleGroup=="Student")
- {
- if(weekDay=="Friday")
- {
- price = 8.45m;
- }
- if(weekDay=="Saturday")
- {
- price = 9.80m;
- }
- if(weekDay=="Sunday")
- {
- price = 10.46m;
- }
- decimal totalPrice = total * price;
- if(total >= 30)
- {
- totalPrice -= totalPrice * 0.15m;
- }
- Console.WriteLine($"Total price:{totalPrice:f2}");
- }
- else if(peopleGroup=="Business")
- {
- if (weekDay == "Friday")
- {
- price = 10.90m;
- }
- if (weekDay == "Saturday")
- {
- price = 15.60m;
- }
- if (weekDay == "Sunday")
- {
- price = 16m;
- }
- decimal totalPrice = total * price;
- Console.WriteLine(totalPrice);
- }
- else if(peopleGroup=="Regular")
- {
- if (weekDay == "Friday")
- {
- price = 15;
- }
- if (weekDay == "Saturday")
- {
- price = 20;
- }
- if (weekDay == "Sunday")
- {
- price = 22.50m;
- }
- decimal totalPrice = total * price;
- Console.WriteLine(totalPrice);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement