473,748 Members | 2,567 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 1110

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

Similar topics

2
1625
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
3578
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
1877
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
12732
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
981
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
1461
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
1402
by: =?Utf-8?B?V2luRGV2?= | last post by:
How can I get/set the dafault login information for a machine?
5
4281
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
2987
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
6944
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
8996
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8832
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9562
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
9386
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
9333
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
9254
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
8255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.