I'm new to the whole programing thing and need to do it for a unit in Tafe. I'm doing C# and using Visual Basic 2012 console Application, The problem I've been given is
Write a program that inputs any 3 numbers from the keyboard and outputs them to the screen in the reverse order. Note: the program code must actually swap the values stored in the variables.
Enhance the above program to also display on screen the highest number or the lowest number, if the user enters “H” display the highest of the 3 numbers, if “L” display the lowest number.
How would i get the console to read "h" and "l" an make them do the thing i need it to.
I'm also not to sure what this part means (Note: the program code must actually swap the values stored in the variables.) So i was trying to mess around with it, so far what i have is
Expand|Select|Wrap|Line Numbers
- Console.WriteLine("Please enter the first number");
- FirstNum = Convert.ToDecimal(Console.ReadLine());
- Console.WriteLine("Please enter the second number");
- SecondNum = Convert.ToDecimal(Console.ReadLine());
- Console.WriteLine("Please enter the third number");
- ThirdNum = Convert.ToDecimal(Console.ReadLine());
- Console.WriteLine("Your numbers in reverse order are");
- Console.WriteLine(+ThirdNum);
- Console.WriteLine(+SecondNum);
- Console.WriteLine(+FirstNum);
- List<decimal> AllNum = new List<decimal>();
- AllNum.Add(FirstNum);
- AllNum.Add(SecondNum);
- AllNum.Add(ThirdNum);