Document Details

Uploaded by Deleted User

Tags

C programming programming concepts software development computer science

Full Transcript

Review Sheet for Test 1 Chapter 1 and 2: Introduction to C Programming Comments and // * Know the difference between block style comments and single line comments. #include , printf(), scanf() * Know what the #include preprocessor directive does and why it is required. * Know what is meant by prepr...

Review Sheet for Test 1 Chapter 1 and 2: Introduction to C Programming Comments and // * Know the difference between block style comments and single line comments. #include , printf(), scanf() * Know what the #include preprocessor directive does and why it is required. * Know what is meant by preprocessor. * Know what the format control string is and how to use it with printf() or scanf(). * Know what the conversion specifier %d is and how it is used. * Demonstrate how to read integers from the keyboard into memory. * Demonstrate how to read floating-point numbers from the keyboard into memory. * Demonstrate how to read characters and strings from the keyboard into memory. * Demonstrate how to print text and/or integers, floating-point, characters, strings to the screen. * Demonstrate how to print the result of a calculation(s) to the screen( e.g., printf("%d", 11+76) ) Identifiers * Know what an identifier refers to. * Know valid and nonvalid identifiers. Arithmetic Operators (+, -, *, /, % ) * Know what a binary operator is. * Know the arithmetic operators. * Know the remainder operator ( % ). * Demonstrate the order of precedence involving a calculation(s) of binary operators. * Know how the arithmetic operators associate when using several in the same statement. * Know what straight-line form is for programming. * Be able to write the straight-line form on an equation on paper. Keywords * Know what a keyword is and why it is reserved. Cast Operator * Know how to use a unary cast operator in a program. * Know what a cast operator does. Floating-point Numbers * Know how to use the %lf conversion specifier in scanf() and printf() functions. * Know how to specify the field width using the %lf conversion specifier. * Know how to specify the precision using the %lf conversion specifier. Assignment Compound Operators (+=, -=, *=, /=, %=) * Know how to use the assignment (compound) operators and how they simplify code. Increment/Decrement Operators (++,--) * Know what the unary ++ or -- does both with pre and post operators. Structured Programming * Be able to explain structured programming using your own words. * Be aware sequential programming (e.g., one line after another in sequence) Data Types (int, char, float, double) * Know the four data types used in C programming. * Know the difference between integer types and floating-point types. COP2270 "C" for Engineers by TC Review Sheet for Test 1 * Know the modifiers signed, unsigned, short, and long. * Demonstrate characters and integers using their ASCII equivalent values. Whitespace and Programming Standards * Know how to write good readable code * Know and understand the importance of writing code that is easy to read and understand Random Numbers and the C Standard Library rand(), srand() * Know what each function does. * Demonstrate how to use each function. * Know what is meant by pseudorandom numbers. Also, know how this can be an advantage. * Know the range of numbers that rand() generates. * Know what the value of RAND_MAX means (not the actual value, but understand what it represents) * Know how to generate random numbers within a specified range. * Know how to select shifting and the scaling factor to generate random numbers in a specified range. n = a + rand() % b; 𝑎 ≤ 𝑛 ≤ (𝑎 + 𝑏 − 1) * Know how to read code that test for even, odd or other numbers that may be divisible by an integer. For example, rand() % 6; does what? Characters * Understand how characters are stored in memory. * Be familiar with ASCII and why ASCII is important. Strings * Know what strings are, how to define them and how they are accessed. * Understand how strings are terminated and why termination is important. Data Type (Signed) * Understand how integer overflow happens for each integer data types * Know why values are limited and the importance of this in C programming COP2270 "C" for Engineers by TC Review Sheet for Test 1 Data Types (Unsigned) * Understand what the unsigned keyword does to a data type declaration * Understand how integer overflow happens * Know why values are limited and the importance of this in C programming Format Specifiers for printf() and scanf() * Know and understand what a format specifier is and how it is used * Be familiar with the format specifiers (not required to know them all, yet) COP2270 "C" for Engineers by TC Review Sheet for Test 1 Chapter 3: Branches if() Selection Statement * Know the general syntax of the if statement. * Know how the body of an if statement begins and ends. * Know when the body of an if statement is executed. Selection Structures * Know the if syntax and body. * Demonstrate how to use the if statement in a program. * Know the if…else syntax and body. * Know when the body of an if…else statement is executed. * Know when the body of the else statement is executed. * Know what the conditional operator ( ? : ) is equivalent to. * Define a ternary operator in C programming and rewrite code using it. Order of evaluation * Be familiar with the precedence rules switch * Understand syntax and use. * Understand its comparison to the if...else statement. * Understand the break; and case that are required in the switch. * Know a specific advantage of using switch in a program. Boolean * #include * Understand what a boolean quantity is. * Know how to use a bool in a program. String Comparisons * #include * Be familiar with strcmp(), strlen(), strcat() Characters * Understand how characters are stored in memory. * Be familiar with ASCII and why ASCII is important. Floating-point comparison * Understand why a threshold is used when comparing floating point numbers (epsilon) Short Circuit Evaluation * Be familiar with the short circuit technique to improve logic operations COP2270 "C" for Engineers by TC

Use Quizgecko on...
Browser
Browser