Docsity

C++ Programming Fundamentals: Loops, Functions, and Key Concepts, Exams of Programming Languages

Toggle sidebar
bg1
C++ Computer programming Exam 2
rated A
Increments - Value means to increase it by one
Decrements - Value means to decrease it by one
While loop - 2 main parts 1) an expression that is tested for a true or false value
(2) a statement or block that is repeated as long as the expression is true - Pre-test
Do-while - -Post-test
For-loop - Format: for (initialization; test; update)
Pre-test
Nested loop 262-264 - A loop that is inside another loop
Infinite Loop 236 - continues to repeat until the program is interrupted
Sentinel 260-261 - A special value that cannot be mistaken as a member of the list
and signals that there are no more values to be entered
pf3
pf4

Partial preview of the text

Download C++ Programming Fundamentals: Loops, Functions, and Key Concepts and more Exams Programming Languages in PDF only on Docsity!

rated A

Increments - Value means to increase it by one Decrements - Value means to decrease it by one While loop - 2 main parts 1) an expression that is tested for a true or false value (2) a statement or block that is repeated as long as the expression is true - Pre-test Do-while - -Post-test For-loop - Format: for (initialization; test; update) Pre-test Nested loop 262-264 - A loop that is inside another loop Infinite Loop 236 - continues to repeat until the program is interrupted Sentinel 260-261 - A special value that cannot be mistaken as a member of the list and signals that there are no more values to be entered

rated A

Counter 241-242 - A variable that is regularly incremented or decremented each time a loop iterates Output files 265, 268 - A file that data is written to Input files 265, 268 - A file that data is read from Function 334-341 - A collection of statements that performs a specific task Function Definition 300-301 - Includes: Return type (int, string, void), function name (main), Parameter list (inside ()), body (inside {}) Function Prototype 309-310 - Eliminates the need to place a function definition before all calls to the function. Function header - FunctionHeader() { }

rated A

What causes a function to end? 322-323 - return statement Overloading function 354-358 - assign the same name to multiple functions, as long as their parameter lists are different. How many functions can you have with the same name? - As many as you want