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 Case
- {
- class Program
- {
- static void Main(string[] args)
- {
- userStart:
- Console.Write("User : ");
- string user = Console.ReadLine();
- if(user == "raxemodz")
- {
- passwordStart:
- Console.Write("Password : ");
- string password = Console.ReadLine();
- if(password == "lovemyself")
- {
- calculatorStart:
- Console.Clear();
- Console.WriteLine("Hello, " + user + " and welcome to my first calculator");
- Console.WriteLine("-------------------------------------------------------------");
- Console.WriteLine("1. Addition\n2. Substraction\n3. Division\n4. Multiplication");
- Console.Write("Choise : ");
- string choise = Console.ReadLine();
- if(choise == "1")
- {
- additionStart:
- int numberOne;
- int numbersTwo;
- Console.Clear();
- Console.WriteLine("-----------------------------");
- Console.Write("Number one : ");
- numberOne = Convert.ToInt32(Console.ReadLine());
- Console.Write("Numbers two : ");
- numbersTwo = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Result : " + (numberOne + numbersTwo));
- Console.WriteLine("-----------------------------");
- string exit = Console.ReadLine();
- if(exit == "exit")
- {
- System.Console.ReadKey();
- goto calculatorStart;
- }
- System.Console.ReadKey();
- goto additionStart;
- }
- else if(choise == "2")
- {
- substractionStart:
- int numberOne;
- int numbersTwo;
- Console.Clear();
- Console.WriteLine("-----------------------------");
- Console.Write("Number one : ");
- numberOne = Convert.ToInt32(Console.ReadLine());
- Console.Write("Numbers two : ");
- numbersTwo = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Result : " + (numberOne - numbersTwo));
- Console.WriteLine("-----------------------------");
- if (exit == "exit")
- {
- System.Console.ReadKey();
- goto calculatorStart;
- }
- System.Console.ReadKey();
- goto substractionStart;
- }
- else if(choise == "3")
- {
- divisionStart:
- int numberOne;
- int numbersTwo;
- Console.Clear();
- Console.WriteLine("-----------------------------");
- Console.Write("Number one : ");
- numberOne = Convert.ToInt32(Console.ReadLine());
- Console.Write("Numbers two : ");
- numbersTwo = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Result : " + (numberOne + numbersTwo));
- Console.WriteLine("-----------------------------");
- if (exit == "exit")
- {
- System.Console.ReadKey();
- goto calculatorStart;
- }
- System.Console.ReadKey();
- goto divisionStart;
- }
- else if(choise == "4")
- {
- multiplicationStart:
- int numberOne;
- int numbersTwo;
- Console.Clear();
- Console.WriteLine("-----------------------------");
- Console.Write("Number one : ");
- numberOne = Convert.ToInt32(Console.ReadLine());
- Console.Write("Numbers two : ");
- numbersTwo = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Result : " + (numberOne + numbersTwo));
- Console.WriteLine("-----------------------------");
- if (exit == "exit")
- {
- System.Console.ReadKey();
- goto calculatorStart;
- }
- System.Console.ReadKey();
- goto multiplicationStart;
- }
- else
- {
- Console.WriteLine("Wrong value please try again.");
- System.Console.ReadKey();
- goto calculatorStart;
- }
- }
- else
- {
- Console.WriteLine("Wrong password please try again.");
- System.Console.ReadKey();
- goto passwordStart;
- }
- }
- else
- {
- Console.WriteLine("Wrong user please try again.");
- System.Console.ReadKey();
- goto userStart;
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement