CS1313 Characters and Strings Lesson 1
Characters & Strings Lesson 1 Outline
1. Characters & Strings Lesson 1 Outline
18. A char is an int #1
2. Numeric Encoding of Non-numeric Data #1 19. A char is an int #2
3. Numeric Encoding of Non-numeric Data #2 20. Declaring char Scalar Variables #1
4. Representing Characters
21. Declaring char Scalar Variables #2
5. How Characters Are Represented #1
22. char Like int Example
6. How Characters Are Represented #2
23. char Scalar Literal Constants
7. Representing Digits
24. char Scalar Literal Constant Example
8. Representing Punctuation
25. Using char Scalar Variables
9. ASCII
26. Using char Scalar Variables Example
10. ASCII Table #1
27. char Arrays #1
11. ASCII Table #2
28. char Arrays #2
12. ASCII Table #3
29. Character Array Example #1
13. ASCII Table #4
30. Character Array Example #2
14. ASCII Confirmation Program #1
31. Character Strings #1
15. ASCII Confirmation Program #2
32. String Terminator
16. ASCII Confirmation Program #3
33. Character String Assignment Example #1
17. ASCII Confirmation Program #4
34. Character String Assignment Example #2
Characters & Strings Lesson 1
CS1313 Fall 2016
1
Numeric Encoding of Non-numeric Data #1
In Programming Project #4, we encoded (represented) the
cloud types using integer values: 1. cirrus 2. cumulus 3. stratus 4. alto-stratus 5. alto-cumulus
6. cirro-stratus
7. cirro-cumulus
8. cumulo-nimbus
9. strato-cumulus
If we wanted to add other items, for example:
10. nimbus
11. strato-nimbus
Characters & Strings Lesson 1
CS1313 Fall 2016
2
Numeric Encoding of Non-numeric Data #2
1. cirrus 2. cumulus 3.... stratus The numbers in these cases have no standard meaning with
respect to the items that they encode; they've been chosen essentially at random.
So, we see that we can encode qualitative (non-numeric) values with quantitative (numeric) values, using arbitrary but distinct numeric values to encode a set of qualities.
Characters & Strings Lesson 1
CS1313 Fall 2016
3
Representing Characters
What's the most important set of non-numeric values in computing?
It's the one that allows the computer to communicate with us in a way that makes sense to actual real live human beings: natural language.
The most efficient way for computers to communicate in a natural language is by writing.
Writing is based on characters. Characters are non-numeric. So, we want a way to encode characters numerically.
Characters & Strings Lesson 1
CS1313 Fall 2016
4
How Characters Are Represented #1
Here's a code you might have used to play secret code games when you were a kid:
'A' = 1, 'B' = 2, 'C' = 3, 'D' = 4, . . ., 'Z' = 26
Now that you've grown up and taken CS1313, you realize that the numbers that you choose can be arbitrary, as long as they're fixed and distinct.
So you could just as easily choose: 'A' = 65, 'B' = 66, 'C' = 67, 'D' = 68, . . ., 'Z' = 90 This is a perfectly reasonable encoding, if the only characters
that you care about are upper case letters. What about lower case?
Characters & Strings Lesson 1
CS1313 Fall 2016
5
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- cs1313 characters and strings lesson 1
- ascii extended ascii and keyboard scan codes for the
- character string data expressions intrinsic functions
- what is ctrl z on mac
- file management search and replace keyboard shortcuts for
- appendix keyboard shortcuts openoffice
- ascii character set and hexadecimal values
- the ascii character set
Related searches
- lesson 1 phrases and clauses answer key
- lesson 1 homework practice
- lesson 1 homework practice lines
- lesson 1 homework practice answers
- powerpoint characters and figures
- characters and setting anchor chart
- lesson 1 physical geography of china and mongolia
- chapter 2 lesson 1 quiz
- lesson 1 2
- lesson 1 planet earth
- lesson 1 physical geography of eastern europe
- lesson 1 1 power and exponents