I just need a little bit of help. I'm pretty new to coding and I watched some videos and managed to get this far without following exact words from videos. I'm just trying to Make a Calculator in a console window that when you type "Multiply" Or "Divide" it will jump to that section and then you can multiply or divide there. Then when you finish it will close the console.
I thought it worked fine at first but since Divide is the second function even if you type "Divide" it won't do anything because it still technically you just went over multiply, you will have to type "Divide" again for it to start the function.
Any help would be appreciated.
using System;
namespace SelfTeaching
{
class Program
{
static void Main(string[] args) //Meathod Aka "Main," This will get called when program Starts
{
int num01;
int num02;
Console.WriteLine("Multiply Or Divide");
if (Console.ReadLine() == "Multiply")
{
Console.Write("Type Number 1: ");
num01 = Convert.ToInt32(Console.ReadLine());
Console.Write("Type Number 2: ");
num02 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("The Answer Is; " + num01 * num02);
Console.ReadKey();
Environment.Exit(0);
}
else if (Console.ReadLine() == "Divide")
{
Console.Write("Type Number 1: ");
num01 = Convert.ToInt32(Console.ReadLine());
Console.Write("Type Number 2: ");
num02 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(num01 + " Divided by " + num02 + " Equals: " + num01 / num02);
Console.ReadKey();
Environment..Exit(0);
}
}
}
}