Data type < 90 000

tmokoena

New member
Joined
Jan 9, 2014
Messages
4
Programming Experience
Beginner
Which of the following is the correct data type to use for a variable that will always
contain a whole number less than 90 000?
o Short
o Long
o Decimal
o Double
o Integer
Please also select on above and advice why?
Thank you in advance.
 
How about you do your own homework? The MSDN documentation for each of those types explains the type of data that each can store so all you need to do is read that documentation and pick the one that most suits the data you need to store. It's worth noting that the Short, Integer and Long data types in VB are implemented using the Int16, Int32 and Int64 .NET structures so you would do well to look up those types directly. You could have used the Help menu in your IDE to open the documentation, as is the case for thousands of Windows applications released in the last few decades, but here is a link to the MSDN web site:

MSDN ? the Microsoft Developer Network

There you can use the Search feature to look up each of those types to find out what they do. You can then provide your own selection and your own rationale for that selection, thereby earning your marks yourself.
 
If you have class notes or a course text book then that should be your first choice for help. Beyond that, the MSDN documentation should always be your first port of call. As I said, you can access it via the Help menu in VS or use the F1 key for context-sensitive help. You can look up specific types or members if you know what you're looking for or just keywords. You won't always find what you need or understand what you find, but the more you use the documentation the better you will get at using it and finding things and understanding them will get easier. You will also often find information that is not useful right away but will come in handy in the future.
 
Back
Top