O'Reilly logo

Beginning Object-Oriented Programming with C# by Jack Purdum

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3

Understanding Data Types

What you will learn in this chapter:

  • Integer data types
  • The range of values for different data types
  • Floating-point data types
  • Which data type should be used to represent financial data
  • The boolean data type
  • When to use one data type versus anotherIntelliSense

wrox.com code downloads for this chapter

You can find the wrox.com code downloads for this chapter at www.wrox.com/remtitle.cgi?isbn=9781118336922 on the Download Code tab. The code in the Chapter03 folder is individually named according to the names throughout this chapter.

As you learned in Chapter 2, most computer programs are centered on solving problems by taking data in one form, transforming it in some manner, and then presenting that new data to the user. The data the computer manipulates can be stored in many different shapes and sizes. When you finish this chapter you will have a good understanding of why C# offers you such flexibility to select a data type.

Computer Data

Computer programs usually input data in one form, process it, and then show the new data on the computer screen. This can invite the question: What is data? Simply stated, data is information. Computer data is information stored in a variable for use in a program. In a broad sense, there are two basic kinds of computer data: numeric data and textual data.

Numeric data is any kind of data that can have arithmetic operations performed on it. You can add, subtract, multiply, and divide numeric data. You can perform ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required