Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- int coffee=7; //Needed coffee per drink //
- int sugar=3; //Needed sugar per drink //
- int stick=1; //Needed stick per drink //
- int glass=1; //Needed glass per drink //
- bool drink=false; //Drink is ordered or not//
- int coquantity=1000; //Started cofee quantity//
- int suquantity=1000; //Started sugar quantity//
- int stquantity=1000; //Started sticks quantity//
- int glquantity=1000; //Started glasses quantity//
- int coprice=30; //Price per cofee//
- int fivest=5; //Coin of 5 stotinki//
- int tenst=10; //Coin of 10 stotinki//
- int twentyst=20; //Coin of 20 stotinki//
- int fiftyst=50; //Coin of 50 stotinki//
- int onelev=100; //Coin of 1 lev //
- int wholesum=0; //Whole payed sum
- int fivedesk=5; //Desk of 5 stotinki//
- int tendesk=10; //Desk of 10 stotinki//
- int twentydesk=20; //Desk of 20 stotinki//
- int fiftydesk=50; //Desk of 50 stotinki//
- int onelevdesk=100; //Desk of 1 lev //
- string choice;
- string SumStr;
- string TempSumStr; //Temporary sum string
- int TempSum=0; //Correct Temporary sum
- int somesum=0; // Coin which is in
- do
- {
- Console.WriteLine ("Искате ли чаша кафе? Натиснете Y за Да и N за Не "); //Here we waitng for his choice
- choice=Console.ReadLine(); //His choice is assigned to "choice"//
- if (choice=="Y")
- {
- Console.WriteLine ("Благодарим Ви за направеният избор. Моля депозирайте 30 стотинки или повече за да приготвя напитката.");
- }
- else
- if (choice=="N")
- {
- Console.WriteLine ("За съжаление днес не предлагаме нищо друго. Помислете пак");
- }
- else if (choice!="Y"||choice!="N")
- {
- Console.WriteLine ("Моля направете коректен избор.");
- }
- }
- while (choice!="Y");
- do
- {
- Console.WriteLine ("Моля въведете стойността на монетата, която пуснахте:");
- TempSumStr=Console.ReadLine();
- bool isNumber = int.TryParse(TempSumStr, out somesum);
- TempSum=(TempSum+somesum);
- if (!isNumber)
- {
- Console.WriteLine("Говорим за стойност на монети, а не за символи!!");
- }
- else if (TempSum <= coprice)
- {
- Console.WriteLine("Все още не сте внесли достатъчна сума за да пиете от нашето страхотно кафе.");
- Console.WriteLine("Моля, пуснете друга монета и въведете стойността и.");
- }
- }
- while (coprice>=TempSum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement