Practicing and exploring
Test your knowledge and understanding by answering some questions, get some hands-on practice, and explore the topics covered in this chapter with deeper research.
Exercise 2.1 – test your knowledge
What type would you choose for the following "numbers"?
- A person's telephone number
- A person's height
- A person's age
- A person's salary
- A book's ISBN
- A book's price
- A book's shipping weight
- A country's population
- The number of stars in the Universe
- The number of employees in each of the small or medium businesses in the UK (up to about 50,000 employees per business)
Exercise 2.2 – practice number sizes and ranges
Create a Console Application project named Ch02_Exercise02 that outputs the number of bytes in memory that each of the following number types use and the minimum and maximum possible values they can have: sbyte
, byte
, short
, ushort
, int
, uint
, long
, ulong
, float
, double
, and decimal
.
Tip
Read the online MSDN documentation...