click below
click below
Normal Size Small Size show me how
CSC 150
Chapter 4
Term | Definition |
---|---|
Control structure | It controls the flow of execution in a program or function |
Kinds of control structure to control execution | Sequence, selection and repeptition |
function of selection control structure | It chooses which alternate to choose |
Different operators | AND operator (&&), or operator (||) and NOT operator (!) |
Operator precedence | An operator precedence determines its value of evaluation |
Decision steps in Algorithm | Algorithm steps that selects from a choice of actions are called Decision steps |
Steps in program development | 1. Problem identification 2. Analysis 3. Design 4. Implementation 5. Testing 6. Maintenance |
Explain about Problem identification | Need to find what the real problem is and the solution to the problem. Required things are selected and eliminate the unimportant aspects. |
Analysis | Identifying the problems i.e. a> input ( the data you have to work with) b> output ( the desired output) c> any additional requirement or constraints on the solution d> Formulas |
Design | This is the step in which problem is solved by making lists of steps called an Algorithm. |
Implementation | It is a step of writing program in computer language from Algorithm. |
Testing | It refers to the step in which program is tested many times to check if the program is well enough to provide you with correct answer. |
Maintenance | Maintenance and updating the program involves modifying a program to remove previously undetected errors. |
Controlling expression | The Controlling expression is an expression with a value of type int or type char, is evaluated and compared to each of the case labels in the label sets until a match is found. |
Label set | A label set is made of one or more labels of the form case followed by a constant value and a colon. |
Types of statement | while, for and do-while |
Loop | Repetition of steps in a program is called Loop. |
Counting Loop | Its repetition is managed by a loop control variable whose value repeats a count. |
Special assignment operator in C | + - * / % |
Compound assignment operator in C | += -= /= %= |
What are the steps involved in for loop? | 1. initialization 2. repetition 3. update |
Incremental operator for 1 | ++ |
Decremented operator for 1 | -- |
Logic error | In programming, a logic error is a bug in a program that causes it to operate incorrectly, but not to terminate abnormally (or crash). The program runs and produces the output, but is incorrect. |
Syntax error | A error that occurs when a program cannot understand the command that has been entered. A program doesn't execute until and unless al syntax errors are corrected. |