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 Task34
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- Random random = new Random();
- string sumValueMoneyOutput = "\n\nСумма за день: ";;
- string сostOrderOutput = "Стоимость заказа: ";
- string acceptPayment = "\nДля того чтобы принять оплату, нажмите любую кнопку на клавиатуре.";
- string endWorkingShift = "Смена окончена!\n";
- int maxValueMoney = 100;
- int minValueMoney = 1;
- int minValueQueue = 1;
- int maxValueQueue = 10;
- int step = 1;
- int сostOrder;
- int sumValueMoney = 0;
- int valueQueue = random.Next(minValueQueue ,maxValueQueue);
- int timeTickPause = 1200;
- Queue<int> аmountPurchasedCustomer = new Queue<int>();
- for(int i = 0; i < valueQueue + step; i++)
- {
- аmountPurchasedCustomer.Enqueue(random.Next(minValueMoney, maxValueMoney));
- }
- while (аmountPurchasedCustomer.Count > 0)
- {
- сostOrder = аmountPurchasedCustomer.Dequeue();
- Console.WriteLine(сostOrderOutput + сostOrder);
- sumValueMoney += сostOrder;
- Console.WriteLine(acceptPayment);
- Console.ReadKey();
- Console.WriteLine(sumValueMoneyOutput + sumValueMoney);
- System.Threading.Thread.Sleep(timeTickPause);
- Console.Clear();
- }
- if (аmountPurchasedCustomer.Count == 0)
- {
- Console.WriteLine(endWorkingShift + sumValueMoneyOutput + sumValueMoney);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement