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 buying_hruchevo
- {
- class Program
- {
- static void Main(string[] args)
- {
- int nachos = 0;
- int borjomi = 0;
- int pepsi = 0;
- int popcorn = 0;
- int money = 300;
- Hruchevo hruchevo = new Hruchevo(nachos, borjomi, pepsi, popcorn);
- Console.WriteLine("ну чё, надо купить hruchevo и сделать пердёжный чай!");
- Console.WriteLine("у тебя 300 рублей. выбирай хрючево с умом, записывая цифру хрючева:");
- Console.WriteLine("\n1. начос 60 рублей\n2. боржоми 0.33 35 рублей\n3. bepis 2 литра 60 рублей\n4. микроволновочный попкорн 25 рублей");
- int choice = Convert.ToInt32(Console.ReadLine());
- if (choice == 1)
- {
- Console.WriteLine("начос наше всё! сколько пачек берём?");
- int nachos_quantity = Convert.ToInt32(Console.ReadLine());
- if (nachos_quantity == 1)
- {
- hruchevo.BuyNachos();
- Console.WriteLine("эта пачка будет сожрана незамедлительно. Осталось " + money + " рублей");
- }
- if (nachos_quantity == 2)
- {
- hruchevo.BuyNachos();
- hruchevo.BuyNachos();
- Console.WriteLine("2 начоса. Осталось " + money + " рублей");
- }
- if (nachos_quantity == 3)
- {
- hruchevo.BuyNachos();
- hruchevo.BuyNachos();
- hruchevo.BuyNachos();
- Console.WriteLine("3 начоса. Осталось " + money + " рублей");
- }
- if (nachos_quantity == 4)
- {
- hruchevo.BuyNachos();
- hruchevo.BuyNachos();
- hruchevo.BuyNachos();
- hruchevo.BuyNachos();
- Console.WriteLine("4 начоса. Осталось " + money + " рублей");
- }
- if (nachos_quantity == 5)
- {
- hruchevo.BuyNachos();
- hruchevo.BuyNachos();
- hruchevo.BuyNachos();
- hruchevo.BuyNachos();
- hruchevo.BuyNachos();
- Console.WriteLine("5 начосов. ты ебанутый? денег то не осталось. жри свой начос");
- }
- if (nachos_quantity == 0)
- Console.WriteLine("ну и нахуя ты выбрал начос, если не хочешь его брать?");
- if (nachos_quantity < 0)
- {
- Console.WriteLine("ты всё испортил!!! то что произошло - невозможно!!! удаляйся нахуй!!!");
- Console.ReadKey();
- Environment.Exit(0);
- }
- КЛАСС Hruchevo:
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace buying_hruchevo
- {
- public class Hruchevo
- {
- private int nachos;
- private int borjomi;
- private int pepsi;
- private int popcorn;
- public int money = 300;
- public Hruchevo(int nachos, int borjomi, int pepsi, int popcorn)
- {
- this.nachos = nachos;
- this.borjomi = borjomi;
- this.pepsi = pepsi;
- this.popcorn = popcorn;
- }
- int nachos_price = 60;
- int borjomi_price = 35;
- int pepsi_price = 60;
- int popcorn_price = 25;
- public int BuyNachos() //тот самый метод(функция). чекает, достаточно ли денег, и если да, то вычитает из денег цену начоса и впихивает это значение в деньги,
- {
- if (money >= nachos_price)
- {
- money = money - nachos_price;
- nachos++;
- }
- return nachos;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement