Programming Fundamentals 1 - C

Ace your homework & exams now with Quizwiz!

ASCII Code

(American Standard Code for Information Interchange) A particular code that specifies the integer representing each char value

Input/Output Function

A C function that performs an input or output function

Preprocessor Directive

A C program line begging with # that provides an instruction to the preprocessor

Library

A collection of useful functions and symbols that may be accessed by a program

Pseudocode

A combination of English phrases and C constructs to describe algorithm steps

Control Structure

A combination of individual instructions into a single logical unit with one entry point and one exit point

Postcondition

A condition assumed to be true after a function executes

Precondition

A condition assumed to be true before a function call

Selection Control Structure

A control structure that chooses among alternative program statements

Loop

A control structure that repeats a group of steps in a program

Flowchart

A diagram that shows the step-by-step execution of a control structure

Structure Chart

A documentation tool that shows the relationships among the subproblems of a problem

Void Function

A function that does not return a value

Cohesive Function

A function that performs a single operation

Compound Statement

A group of statements bracketed by { and } that are executed sequentially

Counter-Controlled Loop (Counting Loop)

A loop whose required number of iterations can be determined before loop execution begins When Used: We can determine before loop execution exactly how many loop repetitions will be needed to solve the problem. 'while' 'for'

Prompt (Prompting Message)

A message displayed to indicate what data to enter and in what form

Cursor

A moving place marker that indicates the next position on the screen where information will be displayed

Variable

A name associated with a memory cell whose value can change

Constant Macro

A name that is replaced by a particular constant value before the program is sent to the compiler

Top-Down Design

A problem-solving method in which your first break a problem into its major subproblems and then solve the subproblems to derive the solution to the original problem

Data Type

A set of values and operations that can be performed on those values

Placeholder

A symbol beginning with % in a format string that indicates where to display the output value

Preprocessor

A system program that modifies a C program prior to its compilation

Syntax Error

A violation of the C grammar rules, detected during program transition (compilation)

Standard Identifier

A word having special meaning but one that a programmer may redefine (but redefinition is not recommended)

Reserved Word

A word that has special meaning in C

&

Address of

Decision Step

An algorithm step that selects several one of several actions

Run-Time Error

An attempt to perform an invalid operation, detected during program execution

Logic Error

An error caused by following an incorrect algorithm

Representational Error

An error due to coding a real number as a finite number of binary digits

Arithmetic Underflow

An error in which a very small computational result is represented as zero

Cancellation Error

An error resulting from applying an arithmetic operation to operands of vastly different magnitudes; effect of smaller operand is lost

Arithmetic Overflow

An error that is an attempt to represent a computational result that is too large

Condition

An expression that is either false (represented by 0) or true (usually represented by 1)

Logical Expression

An expression that uses one or more of the logical operators && (and), || (or), ! (not)

Actual Argument

An expression used inside the parentheses of a function call

Mixed-Type Expression

An expression with operands of different types

Formal Parameter

An identifier that represents a corresponding actual argument in a function definition

Nested 'if' Statement

An if statement with another if statement as its true task or its false task

Input Operation

An instruction that copies data from an input device into memory

Output Operation

An instruction that displays information stored in memory

Assignment Statement

An instruction that stores a value or a computational result in a variable

Unary Operator

An operator that has one operand

Unary Operator

An operator with one operand

Binary Operator

An operator with two operands

Bitwise Negation

Application of the ~ operator to an integer produces a value in which each bit of the operand has been replaced by its negation

Input Arguments

Arguments used to pass information into a function subprogram

Output Arguments

Arguments used to return results to the calling function

=

Assignment

~

Bitwise Negation

+=, -=, *=

Compound Assignment

? :

Conditional

Type Cast

Converting an expression to a different type by writing the desired type in parenthesis in front of the expression

Char

Data type used to represent and individual character value, a letter, a digit or a specific symbol

Double

Data type used to represent real numbers (with decimal)

--

Decrement

/

Division

Function Argument

Enclosed in parentheses following the function name; provides information needed by the function

==

Equality

>

Greater than

>=

Greater than or equal to

Format String

In a call to printf, a string of characters enclosed in quotes (""), which specifies the form of the output line

Print List

In a call to printf, the variables or expressions whose values are displayed

++

Increment

*

Indirection or multiplication

!=

Inequality

Program Documentation

Information (comments) that enhances the readability of a program

<<

Left Shift

<

Less than

<=

Less than or equal to

&&

Logical and

||

Logical or

Executable Statements

Program lines that are converted to machine language instructions and executed by the compiler

%

Remainder

Debugging

Removing errors from a program

>>

Right Shift

Variable Declarations

Statements that communicate to the compiler the names of variables in the program and the kind of information stored in each variable

Hand Trace (desk check)

Step-by-step simulation of an algorithm's execution

Short-Circuit Evaluation

Stopping evaluation of a logical expression as soon as its value can be determined

Comment

Text beginning with / * and ending with */ that provides supplementary information but is ignored by the preprocessor and compiler

Bitwise and, xor, and or

The bitwise operators & (and), ^ (xor), and | (or) all take two integer operands that are viewed as strings of bits. The operators determine each bit of their result by considering corresponding bits of each operand.

Newline Escape Sequence

The character sequence \n, which is used in a format string to terminate an output line

Sequential Evaluation

The comma operator, evaluates its two operands in sequence, yielding the value of the second operand as the value of the expression. The value of the first operand is discarded.

Logical Complement

The complement of a condition has the value 1 (true) when the condition;s value is 0 (false); the complement of a condition has the value 0 (false) when the condition's value is nonzero(true)

Conditional

The conditional operator '? :' takes three operands, ' c ? r1 : r2 The value of an expression using the conditional is the value of either its second or third operand, depending on the value the first operand.

Mixed-Type Assignment

The expression being evaluated and the variable to which it is assigned have different data types

Declarations

The part of the program that tells the compiler the names of memory cells in a program

Shift Operators

The shift operators << (left) and >> (right) take two integer operands. The value of the operand is the number to be shifted and is viewed as a collection of bits that can be moved.

Loop Body

The statements that are repeated in the loop

Return Statement

Transfers control from your program to the operating system

-

Unary minus or subtraction

+

Unary plus or addition

Sentinel-Controlled Loop

When Used: Input of a list of data of any length ended by a special value. 'while' 'for'

Endfile-Controlled Loop

When Used: Input of a single list of data of any length from a data file. 'while' 'for'

Procedural Abstraction

a programming technique in which a main function consists of a sequence of function calls and each function is implemented separately

ANSI C Reserved Words

auto double int struct break else long switch case enum register typedef char extern return union const float short unsigned continue for signed void default goto sizeof volatile do if static while

Int

data type is used to represent integer in C


Related study sets

NGO: Non-Governmental Organization

View Set

Amplify Natural Selection Unit Review

View Set

Hospitality Operations Final Exam

View Set

Lesson 6.5 Applying Systems of Equations, Lesson 6.4 Elimination Using Multiplication, Lesson 6.3 Elimination Using Addition and Subtraction, Lesson 6.1 Graphing Systems of Equations

View Set

Harr 7.9 - Microbiology - Mycology

View Set

Testout Chapter 1 Linux Admin Midterm 2.19.19 1.1-1.11

View Set

Chapter 9- Hygiene and Care of the Patients Environment

View Set

Chapter 10 - Blood Gas Monitoring

View Set