- C# 6 and .NET Core 1.0:Modern Cross:Platform Development
- Mark J. Price
- 279字
- 2021-07-09 20:15:41
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 for Composite Formatting, available at https://msdn.microsoft.com/en-us/library/txafckwd(v=vs.110).aspx, to learn how to align text in a console application.
The output of your application should look something like the following screenshot:

Exercise 2.3 – explore topics
Use the following links to read more about the topics covered in this chapter:
- C# Keywords: https://msdn.microsoft.com/en-us/library/x53a06bb.aspx
- Integral Types Table (C# Reference): https://msdn.microsoft.com/en-us/library/exx3b86w.aspx
- Floating-Point Types Table (C# Reference): https://msdn.microsoft.com/en-us/library/9ahet949.aspx
- decimal (C# Reference): https://msdn.microsoft.com/en-us/library/364x0z75.aspx
- bool (C# Reference): https://msdn.microsoft.com/en-us/library/c8f5xwh7.aspx
- char (C# Reference): https://msdn.microsoft.com/en-us/library/x9h8tsay.aspx
- string (C# Reference): https://msdn.microsoft.com/en-us/library/362314fe.aspx
- var (C# Reference): https://msdn.microsoft.com/en-us/library/bb383973.aspx
- Nullable Types (C# Programming Guide): https://msdn.microsoft.com/en-us/library/1t3y8s4s.aspx
- Standard Numeric Format Strings: https://msdn.microsoft.com/en-us/library/dwhawy9k(v=vs.110).aspx
- Custom Numeric Format Strings: https://msdn.microsoft.com/en-us/library/0c899ak8(v=vs.110).aspx
- Custom Date and Time Format Strings: https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx
- Composite Formatting: https://msdn.microsoft.com/en-us/library/txafckwd(v=vs.110).aspx
- Console Class: https://msdn.microsoft.com/en-us/library/system.console(v=vs.110).aspx
- C# Operators: https://msdn.microsoft.com/en-us/library/6a71f45d.aspx
- Languages features in C# 6 and VB 14: https://github.com/dotnet/roslyn/wiki/Languages-features-in-C%23-6-and-VB-14
- Implementing VMware Horizon 7(Second Edition)
- 深入核心的敏捷開(kāi)發(fā):ThoughtWorks五大關(guān)鍵實(shí)踐
- Mastering OpenCV Android Application Programming
- Python語(yǔ)言程序設(shè)計(jì)
- MATLAB應(yīng)用與實(shí)驗(yàn)教程
- NumPy Essentials
- Podman實(shí)戰(zhàn)
- Visual C
- Mastering KnockoutJS
- Mastering ArcGIS Enterprise Administration
- HoloLens與混合現(xiàn)實(shí)開(kāi)發(fā)
- UML2面向?qū)ο蠓治雠c設(shè)計(jì)(第2版)
- 超好玩的Scratch 3.5少兒編程
- 3D Printing Designs:Octopus Pencil Holder
- 游戲設(shè)計(jì)的底層邏輯