Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace PasswordGenerator
- {
- class Program
- {
- static void Main(string[] args)
- {
- double moneForArtist = double.Parse(Console.ReadLine());
- string numberOfPeople = Console.ReadLine();
- double price = 0;
- double totalNumberOfPeople = 0;
- while (numberOfPeople != "The restaurant is full")
- {
- double currentPrice = 0;
- if ((int.Parse(numberOfPeople) < 5))
- {
- currentPrice = double.Parse(numberOfPeople) * 100;
- }
- else
- {
- currentPrice = double.Parse(numberOfPeople) * 70;
- }
- price += currentPrice;
- totalNumberOfPeople += double.Parse(numberOfPeople);
- numberOfPeople = Console.ReadLine();
- }
- if (price >= moneForArtist)
- {
- Console.WriteLine($"You have {totalNumberOfPeople} guests and {price - moneForArtist} leva left.");
- }
- else
- {
- Console.WriteLine($"You have {totalNumberOfPeople} guests and {price} leva income, but no singer.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement