E50a Section -- November 23rd, 1998

Characters and ASCII (American Standard Code for Information Exchange)

Basically, each characters gets represented by a code, known as the ASCII value. There are other standards, like UTF and EBCDIC. The digits are represented by codes 48 through 57, the upper-case letters by codes 65 through 90. and the lower case letters are represented by codes 97 through 122.

Why is this useful?
Examples:

Randomness

Randomness lets you add some fun to your program without needing the user's input. This is useful if you want your program to behave differently every time you run it (for example, for a solitaire game, you want to deal the cards differently for each game).
How to add randomness to your program:

File input/output

Reading from a file or writing to a file can be very useful. For example, suppose that one of your friends has all this data that needs to be processed. Your friend can just send it to you in a file, and you will read the data from that file, process it, and give him the results. You might want to write the results to another file...

How can you do this?

Note: