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 Calculator
- { class Program
- {
- static void Main(string[] args)
- {
- {
- // Intro
- Console.WriteLine("Welcome to Calculator");
- Console.WriteLine("");
- Console.WriteLine("Made by *enter_name*");
- Console.WriteLine("");
- // First Number
- Console.WriteLine("Choose yout first number");
- Console.WriteLine("");
- string num1 = Console.ReadLine();
- int number = Convert.ToInt32(num1);
- // Second Number
- Console.WriteLine("Choose your second number");
- Console.WriteLine("");
- string num2 = Console.ReadLine();
- int number2 = Convert.ToInt32(num2);
- // Operation
- Console.WriteLine("Choose your operation ( + - * / )");
- string opr = Console.ReadLine();
- char minus = '-';
- char plus = '+';
- char multiply = '*';
- char division = '/';
- // Background Proccess
- Console.WriteLine("The answer to your equasion is : ");
- Console.WriteLine("");
- if (opr == Convert.ToString(minus))
- {
- Console.WriteLine(number - number2);
- }
- else if (opr == Convert.ToString(plus))
- {
- Console.WriteLine(number + number2);
- }
- else if (opr == Convert.ToString(multiply))
- {
- Console.WriteLine(number * number2);
- }
- else if (opr == Convert.ToString(division))
- {
- Console.WriteLine(number / number2);
- }
- // Outro
- Console.WriteLine("");
- Console.WriteLine("");
- Console.WriteLine("Thank You For Using Calculator \n - *enter_name*");
- Console.WriteLine("");
- Console.WriteLine("Write anything below to see if the program ran correctly.");
- // Used to make the program run until you close it
- Console.ReadLine();
- // Answer if the program ran correctly
- bool program = true;
- if (program)
- Console.WriteLine("The program is in perfect condition");
- else
- Console.WriteLine("The program malfunctioned try debugging it...");
- Console.ReadLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement