473,386 Members | 1,962 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Getting entered keys to display information

Hello all

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
  1. Console.WriteLine("Please enter the first number");
  2. FirstNum = Convert.ToDecimal(Console.ReadLine());
  3. Console.WriteLine("Please enter the second number");
  4. SecondNum = Convert.ToDecimal(Console.ReadLine());
  5. Console.WriteLine("Please enter the third number");
  6. ThirdNum = Convert.ToDecimal(Console.ReadLine());
  7.  
  8. Console.WriteLine("Your numbers in reverse order are");
  9. Console.WriteLine(+ThirdNum);
  10. Console.WriteLine(+SecondNum);
  11. Console.WriteLine(+FirstNum);
  12.  
  13. List<decimal> AllNum = new List<decimal>();
  14. AllNum.Add(FirstNum);
  15. AllNum.Add(SecondNum);
  16. AllNum.Add(ThirdNum);
Am i on the right track and how would i get console to do the whole high low thing any help would be nice.
Sep 21 '13 #1
0 1098

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Skulled2003 | last post by:
Hi there, I was wondering if it was possible to get the screen display size and other associated properties somehow either using python modules or if possible using Tk methods. Thanks a lot. ...
9
by: gerben | last post by:
LS, I want to make a content management system. Therefore I have to be able to change the content of my mysql database. I'm writing the content to text boxes in forms, to be able to edit them. ...
0
by: munif | last post by:
i wnat write a C++ program that would read from a CD and display information about files and folders in the given CD In simple words you would be performing a simple (ls -l) or (DIR /S) on the...
3
by: matthewemiclea | last post by:
I am trying to display information in Access on a form that takes information from many different queries and puts them together on a spreadsheet or chart. Some specific info: The information I...
0
by: Stephen Noronha | last post by:
Hi all, I have a question, I have a restricted page (lots of data) and it really causes problems if i display all data, so I want to use a pop up to display the rest of the data, if i use a...
1
by: daddio | last post by:
I'm a divorced dad that travels constantly with my job and I wanted a way to let my daughter know where I am. I built a simple little website but it needs a little bit of complexity in order to...
2
by: =?Utf-8?B?V2luRGV2?= | last post by:
How can I get/set the dafault login information for a machine?
5
by: pankajit09 | last post by:
Hello, I have 2 arrays . One is a master array and the other slave array. I want the keys from the master array of the values which are present in both the arrays .
0
by: santoshslonkar | last post by:
Hi, i am working on the unit testing of my application. i have used Mcrosoft visual studio 2005 performance tools. i have occured following error message we i lunch my site. "The web site...
7
by: ieda | last post by:
I want to display information when value in listbox selected. Below is my code:- This code to get value option in listbox <? $query = "select courseTitle from training where startDate > NOW()...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.