Module 1.4 Flashcards
● Bits
● Bytes
● Binary Number System (base 2)
● Decimal Numebr System (base 10)
● Binary number System
● Octal Number System (base 8)
● Hexadecimal Number System (base 16)
Data Representation
○ With only 8 bits, you can represent 28 or 256 different decimal values ranging from 0 to 255. This is 256 different characters or different combinations of 0 and 1.
○ The binary numbering system is used to represent the language of the computer. The binary number 01000001 is equivalent to the decimal value 65, which represents the uppercase character A.
○ Fortunately, you do not have to retrain yourself to speak that language.
Character Sets
The character set used by programmers of C# is called ;
the universal character-encoding schema
Unicode
ASCII meaning
American Standard Code for Information Interchange (ASCII)
Kilobyte 2^10 (1,024) (KB)
Megabyte 2^20 (1,048,567) (MB)
Gigabyte 2^30 (1,073,741,824) (GB)
Terabyte 2^40 (1,099,511,627,776) (TB)
Petabyte 2^50 (1,125,899,906,842,624) (PB)
Exabyte 2^60 (1,152,921,504,606,846,976,) (EB)
Zettabyte 2^70 (1,180,591,620,717,411,303,424,) (ZB)
Yottabyte 2^80 (1,208,925,819,614,629,174,706,176) (YB)
Kilobyte 2^10 (1,024) (KB)
Megabyte 2^20 (1,048,567) (MB)
Gigabyte 2^30 (1,073,741,824) (GB)
Terabyte 2^40 (1,099,511,627,776) (TB)
Petabyte 2^50 (1,125,899,906,842,624) (PB)
Exabyte 2^60 (1,152,921,504,606,846,976,) (EB)
Zettabyte 2^70 (1,180,591,620,717,411,303,424,) (ZB)
Yottabyte 2^80 (1,208,925,819,614,629,174,706,176) (YB)
Data Representation Trivia
● Notice that kilo is about a thousand, mega is about a million, giga is about a billion, and so on.
● So, when you think about a machine that has a 64-bit processor with 4 GB of RAM and 1 TB of hard disk space, you know that the machine can process 64 bits at one time, store approximately 4 billion characters in memory, and has storage capacity for approximately 1 trillion characters on the hard disk.
TRIVIA LANG
○ These are names of elements that appear in a program, such as data items. Some _______ are predefined; others are user-defined.
○ Examples: System, Main, Console, WriteLine
Identifiers
Rules for creating an identifier in C#
1. A combination of alphabetic characters (a–z and A–Z), numeric digits (0–9), and the underscores (_) can be used. Identifiers can be long; however, many systems consider the first 31 characters unique.
- The first character in the name may not be a numeric digit.
- No embedded spaces can be placed between the characters. This
means you cannot separate words in a name by a space. Normally, you concatenate (append) second and subsequent words onto the identifier by capitalizing the beginning letter of each word after the first. - Keywords are predefined reserved identifiers that have special meanings to the compiler. They cannot be used as identifiers in your program.
Rules for creating an identifier in C#
- represents an area in the computer memory where a value of a particular data type can be stored. When you declare this, you allocate memory for that data item in your program.
-Declaring this requires that you select an identifier and determine what type of data will appear in the memory cell. The syntax for declaring a variable follows:
type identifier = expression;
Variables
A variable’s value can change. These are the numbers, characters, and combinations of characters used in your program. They can be assigned to a variable or used
in an expression.
Literal Values
Every time you declare a variable in the C# language, you are actually instantiating a class (creating an object). If you declare three variables of int type, you are instantiating the class three times; three int objects are created. The following statement creates three int objects:
int homeWorkScore1;
int examNumber1;
int numberOfPointsScored;
no answer
- are often used to give a value to an object’s data portion. This can be done when the object is created or later in the program statements. A value such as 100 could be assigned to homeWorkScore1 using the following statement:
homeWorkScore1 = 100;
- Here 100 is a numeric literal. The contents of the memory location where the variable homeWorkScore1 stored the value 100 can be changed; however, the literal value of 100 cannot be changed. 100 is always 100.
Literal Values
Grade point average
Current age
Full name
Final grade in a course
Description grade
gradePointAverage
age
studentName
courseGrade
Identifier
double / 3.99
int / 19
string / Elizabeth Hill
char / A
Data Type / Data