You are on page 1of 14

MODULE 1 STUDY GUIDE

1. Computer Program, a sequence of instructions written to perform a specified task for


a computer.
2. Source code , is text written in a computer programming language.
3. Computer programming , is the process of designing, writing, testing, debugging/
troubleshooting, and maintaining the source code of computer programs.
4. Program, is a self-contained set of instructions used to operate a computer to produce a
specific result.
5. Programming, is the process of writing a program, or software.
6. Machine Language, refers to programs that is also called executables, consist of
binary instructions.
7. Opcode, refers to the operation to be performed in a Machine Language program.
8. Assembly Language, is a programming language with symbolic names for opcodes, and
decimals or labels for memory addresses.
9. Assembler, is used to translate assembly language programs into machine instructions.
10. Low-level languages, refers to computer languages that use instructions tied directly to one
type of computer.
11. High-level Languages , refers to computer languages that use instructions resemble,
written languages, such as English, and can be run on a variety of computer types.
12. Source code , refers to programs written in a high- or low-level language.
13. Interpreter , translates the source code into machine instructions where each statement
is translated individually and executed immediately after translation.
14. Compiler, translates the source code into machine instructions where all statements are
translated and stored as an executable program, or object program; execution occurs later.
15. Linker, combines all of the compiled code required for the program.
16. Object-Oriented programs with reusable objects, containing code and data, that
are manipulated.
17. ALGOL 60, was developed as an alternative to FORTRAN taking from it some concepts
of structured programming which would later inspire most procedural languages.
18. It directly influenced the development of data types in C. Nevertheless, ALGOL was a non-
specific language and its abstraction made it impractical to solve most commercial tasks. ALGOL
68
19. Martin Richards . He developed the BCPL (Basic Combined Programming Language),
that signified a simplification of CPL but kept most important features the language
offered.
20. Ken Thompson. He immersed in the development of UNIX at Bell Labs, created the B
language. It was a port of BCPL for a specific machine and system (DEC PDP-7 and UNIX), and
was adapted to his particular taste and necessities.
21. Algorithm, is the step-by-step sequence of instructions that describe how the data is
to be processed to produce the desired output.
22. Pseudocode, is an English-like phrases used to describe the algorithm.
23. Formula, is a description of a mathematical equation.
24. Flowchart is a diagram showing the flow of instructions in an algorithm.
25. Pseudo, it means false; thus, pseudocode means false code. It looks like (imitates)
real code but it is NOT real code.
26. Terminator, refers to the flowchart symbol that shows the start and stop points in
a process.
27. Line, refers to the flowchart symbol that shows the direction that the process flows.
28. Decision, refers to the flowchart symbol that indicates a question or branch in
the process flow.
29. Data(I/O), refers to the flowchart symbol that indicates inputs and outputs from
a process.
30. Process, it refers to the flowchart symbol that shows action step.
MODULE 2 STUDY GUIDE

1. Computer programming -It is the process of implementing the algorithm using a language
the computer can understand.
2. Programming language- It is a set of special words, symbols and rules for constructing
a program.
3. Syntax- It governs how valid instructions are to be written in a given language.
4. Semantics - It refers to rules that determines the meaning attached to instructions written in a
given language.
5. Comment line- It refers to lines beginning with two slash signs (//) which do not have any
effect on the behavior of the program.
6. Directives for the preprocessor- It refers to lines beginning with a hash sign (#).
7. Namespace- It is where all the elements of the standard C++ library are declared.
8. int main()- This line corresponds to the beginning of the definition of the main function.
9. Statement- It is a simple or compound expression that can actually produce some effect.
10. return 0- It causes the main function to finish.
11. It is the escape code for newline. \n
12. It is the escape code for carriage return. \r
13. It is the escape code for tab. \t
14. It is the escape code for backspace. \b
15. It is the escape code for form feed. \f
16. It is the escape code for alert(beep). \a
17. It is the escape code for single quote. \’
18. It is the escape code for double quote. \”
19. It is the escape code for question mark. \?
20. It is the escape code for backslash. \\
21. Stream- It is an object where a program can either insert or extract characters to/from it.
22. Output statement- It gets the value stored in the variable and displays it on the screen.
23. Cout- It is the identifier that is used along with the insertion operator to send an output to
the screen.
24. Endl- It is used to add a new-line.
25. Cin- It is the identifier used along with the extraction operator to get an input from the user.
26. Setw(n)- It is used to specify a field for output display where n is an integer expression
representing the field width
27. Showpoint- It is used when the decimal part of a number is 0.
28. Cin.ignore()- It is used to flush the buffer and skip characters in the input stream.
29. Strcmp(string1,string2)- It is used to compare two addresses or process String comparisons
in C++.
30. Getline- It is a C++ function used to read a string containing blank spaces or tabs.
Module3SubTopic1: M3ST1

1. Modulus- It is the arithmetic operator that finds the remainder when one number is divided
by another.
2. Boolean- It refers to the relational operator that can have a result value of true or false.
3. Logical- It refers to operators that are used to combine two expressions.
4. ?- The conditional operators ___ and : are used to construct conditional expressions.
5. Constructor initialization- The other way to initialize variables
6. Const - Using this prefix you can declare constants with a specify type in the same way as
you would with a variable.
7. #define- It is a directive that is used to define own names for constants.
8. Grouping- It defines the precedence order in which operators are evaluated in case
several operators of the same level in an expression.
9. &&- It is the symbol for logical AND.
10. ||- It is the symbol for logical OR.
11. ++- It is the symbol for increment operator.
12. - -- It is the symbol for decrement operator.
13. = - It is the symbol or character for assignment operator.
14. Increment- It increases the value of a number by 1.
15. Decrement- It decreases the value of a number by 1.
16. Type casting- It is the process of converting the data type of the variable to another data type.
17. Implicit conversion- It is done automatically by the compiler whenever data from different
types is intermixed.
18. cout.fill()- In formatting numbers, it is the function used to change the default padding.
19. cmath(math.h)- It is the Standard C library for mathematical operations.
20. atan2- It is the Trigonometric function that computes the arc tangent with two parameters.
21. sin()- It is the Trigonometric function that computes the sine.
22. tan()- It is the Trigonometric function that computes the tangent.
23. acos()- It is the Trigonometric function that computes the arc cosine.
24. cosh()- It is the Hyperbolic function that computes the hyperbolic cosine.
25. sinh()- It is the Hyperbolic function that computes the hyperbolic sine.
26. tanh()- It is the Hyperbolic function that computes the hyperbolic tangent.
27. pow()- It is the Power function that computes the raise to power.
28. sqrt()- It is the Power function that computes the square root.
29. exp()- It is the Exponential and Logarithmic function that computes exponential function.
30. Frexp()- It is the Exponential and Logarithmic function that gets significant and exponent.
MODULE 4 STUDY GUIDE

1. Flow of control- It refers to the order in which a program’s statements are executed.
2. Sequential- Normal flow of control for all programs
3. Conditions- Relational expression are also known as ___.
4. short-circuit evaluation - The evaluation feature for the && and || operators that makes the
evaluation of an expression stop as soon as it is determined that an expression is false is
known as ____.
5. Selection- It is the second control logic structure, which is used to choose between two or
more alternative actions.
6. Boolean expression- It is an expression that evaluates to either true or false.
7. If statement- It allows you to control if a program enters a section of code or not based
on whether a given condition is true or false.
8. Selection- The flow of control used to select which statements are performed next based on
a condition.
9. Repetition- The flow of control used to repeat a set of statements.
10. Invocation- The flow of control used to is used to invoke a sequence of instructions using
a single statement, as in calling a function.

SIMULATE THE PROGRAMS TO DETERMINE THE OUTPUT

1.

int a=10, b=20;


if (a>b){
cout<<"a is greater than b";
}else if(a==b){
cout<<"a is equal to b";
}
else{
cout<<"a is less than b";
}
2.

int a=20, b=10;


if (a>b){
cout<<"a is greater than b";
}else if(a==b){
cout<<"a is equal to b";
}
else{
cout<<"a is less than b";
}

3.
int a=20, b=20;
if (a>b){
cout<<"a is greater than b";
}else if(a>=b){
cout<<"a is equal to b";
}
else{
cout<<"a is less than b";
}

4.

Assuming a=10 b=80

int a,b,sum;
cout<<”Enter a number =”;
cin>>a;
cout<<”Enter a number =”;
cin>>b;
sum=a+b;
cout<<”sum=”<<sum;

Assuming a=10 b=80

int a,b,sum;
cout<<”Enter a number =”;
cin>>a;
cout<<”Enter a number =”;
cin>>b;
sum=a+b;
cout<<”sum=”<<sum<<endl;
if (sum>=90){
cout<<”sum is greater or equal to 90”;
}
else if(sum<90){
cout<<”sum is less than 90”;
}
else{
cout<<”no result”<<endl;
}
STUDY GUIDE Module5
SIMULATE THE PROGRAMS TO DETERMINE THE OUTPUT/RESULT

1.

int num=5;
while(num>=0){
cout<<num<<endl;
++num;
}

What is the output?


5

2.

int num=5;
while(num>=0){
cout<<num;
- -num;
}

What is the output?


543210

3.
int num=5;
do{
cout<<num;
--num;
}while(num<=0);

What is the output?


5

4.
int num=5;
do{
cout<<num;
++num;
}while(num>=10);

What is the output?


5678910

5.
int num=10;
do{
cout<<num;
--num;
}while(num>=0);

What is the output?


109876543210

1.

for(int x=1; x<5;x++){


cout<<x;
}

Output
1234

2.

for(int x=5; x>0;x--){


cout<<x;
}

Output
54321

3.

for(int x=5; x>=0;x--){


cout<<x;
}
cout<<endl;
for(int y=1; y<=5; y++){
cout<<y;
}
Output
543210
12345
4.
for(int x=5; x>0;x--){
cout<<x;
}
cout<<endl;
for(int y=1; y<6; y++){
cout<<y;
}
Output
54321
12345

5.

for(int x=1; x>3;x--){


for(int y=1; y<=5; y++){
cout<<y;
}
cout<<endl;
}

Output:
12345
12345
STUDY GUIDE Module 6

SIMULATE THE PROGRAMS TO DETERMINE THE RESULT/OUTPUT

1.

int myNum[5]={1,2,3,4,5};

int a=0;

for(int x=0; x<5;x++){

a+=myNum[x];

cout<<a;

what is the value of a? = 15

2.

int myNum[5]={1,2,3,4,5};

int a=0;

for(int x=0; x<3;x++){

a+=myNum[x];

cout<<a;

what is the value of a? = 6

3.
int myNum[5]={1,2,3,4,5};

int a=0;

for(int x=4; x>=0;x--){

a+=myNum[x];

cout<<a;

what is the value of a?


= 15
4.
int myNum[10]={1,2,3,4,5,6,7,8,9,10};

int a=0;

for(int x=4; x>=0;x--){

if(myNum[x]%2==0){

a+=myNum[x];

cout<<a;

what is the value of a? = 6

5.
int myNum[10]={1,2,3,4,5,6,7,8,9,10};

int a=0;

for(int x=4; x>=0;x--){

if(myNum[x]%2=!0){

a++;

cout<<a;

what is the value of a? = ERROR


1.
int myArray [2][3] = {1,2,3}, {4,5,6};
int a;
for(int x=0; x<2;x++){
for(int y=0; y<3; y++){
a++;
}
}
cout<<a;
what is the value of a? = ERROR

2.

int myArray [2][3] = {1,2,3}, {4,5,6};


int a;
for(int x=0; x<2;x++){
for(int y=0; y<3; y++){
a+=myArray[x][y];
}
}
cout<<a;

what is the value of a? = ERROR

3.

int myArray [2][3] = {1,2,3}, {4,5,6};


int a;
for(int x=0; x<2;x++){
for(int y=0; y<3; y++){
if(myArray[x][y]%2==0)
a++;
}
}
cout<<a;
what is the value of a? = ERROR

4.
int myArray [2][3] = {1,2,3}, {4,5,6};
int a;
for(int x=0; x<2;x++){
for(int y=0; y<3; y++){
if(myArray[x][y]%2==0)
a+=myArray[x][y];
}
}
cout<<a;
what is the value of a? = ERROR

5.

int myArray [2][3] = {1,2,3}, {4,5,6};


int a;
for(int x=0; x<2;x++){
for(int y=0; y<3; y++){
if(myArray[x][y]%2!=0)
a+=myArray[x][y];
}
}
cout<<a;
what is the value of a? = ERROR

You might also like