1 / 5

Data Types

Data Types. Basic data types: Text Numeric Numeric data stored by numeric variables Text data stored by string, text, or character variables – surrounded by “ “ (ie. “color”). Types of Data. Numeric Data Integer data (whole numbers) 10 25 -45 0

rafer
Télécharger la présentation

Data Types

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Data Types • Basic data types: • Text • Numeric • Numeric data • stored by numeric variables • Text data • stored by string, text, or character variables – • surrounded by “ “ (ie. “color”)

  2. Types of Data • Numeric Data • Integer data (whole numbers) • 10 25 -45 0 • Real (Floating point) data (numbers that have a decimal point) • 23.5 -5.0 • Note: 5 and 5.0 are stored differently in a computer even though they have the same value. The first, 5 is an Integer but the second, 5.0 is a Real number. • Character data (alphanumerics) • All the characters you can type at the keyboard • The type is String or Character

  3. Numeric data types: • Integer: whole numbers only • Floating-point: fractional numeric values with decimal points

  4. Numeric Data • Integer data (whole numbers) • 10 25 -45 0 • Real (Floating point) data (numbers that have a decimal point) • 23.5 -5.0 • Note: 5 and 5.0 are stored differently in a computer even though they have the same value. The first, 5 is an Integer but the second, 5.0 is a Real number. • Character data (alphanumerics) • All the characters you can type at the keyboard • The type is String or Character

  5. Concatenation • Concatenation takes two strings and joins them to create a string result • The concatenation operator is symbolized, in pseudocode, with a + sign • Example: if: • String1 = “yellow” and String2 = “duckie” • then the statement: • Set MyFriend = String1 + String2 • results in: • MyFriend = “yellow duckie”

More Related