473,699 Members | 2,779 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting entered keys to display information

1 New Member
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 1107

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

Similar topics

2
1622
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. Vinod __________________________________________________________________ Switch to the New Netscape Internet Service.
9
3575
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. This works fine as long as there are no ' in the text. The information in the database is correct, but when it is shown in the form, everything after the quote is not shown.
0
1873
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 CD. LOOk at this code /*
3
12728
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 am displaying consists of a work order schedule(for the current date), work orders completed , work orders not completed, a past due schedule, past due completed, and past due not completed. These are grouped by workcenters. Therefore, one...
0
979
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 hyperlink like this e.g: <asp:Hyperlink Runat="server" NavigateUrl="http://google.com/" onclick="window.open (this.href, 'popupwindow', 'width=400,height=300,scrollbars,resizable'); return false;" ID="Hyperlink2"...
1
1458
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 work. I want to create a database in the form of a calender. I want to be able to set a city, state, and 2 images for a date and have the index page recall the current city, state based on the current date. A non-working example of what I'm trying to...
2
1401
by: =?Utf-8?B?V2luRGV2?= | last post by:
How can I get/set the dafault login information for a machine?
5
4278
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
2984
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 could not be configured correctly; getting ASP.NET process information failed. Requesting 'http://localhost:4750/ASSESSMENT/VSEnterpriseHelper.axd' returned an error: The remote server returned an error: (500) Internal Server Error." for this error i...
7
6942
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() "; $result = mysql_query($query); print "<SELECT name=item>"; while ($line = mysql_fetch_array($result))
0
9192
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9054
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8939
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8895
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3071
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2362
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.