Professional Documents
Culture Documents
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.
1.
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.
int a,b,sum;
cout<<”Enter a number =”;
cin>>a;
cout<<”Enter a number =”;
cin>>b;
sum=a+b;
cout<<”sum=”<<sum;
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;
}
2.
int num=5;
while(num>=0){
cout<<num;
- -num;
}
3.
int num=5;
do{
cout<<num;
--num;
}while(num<=0);
4.
int num=5;
do{
cout<<num;
++num;
}while(num>=10);
5.
int num=10;
do{
cout<<num;
--num;
}while(num>=0);
1.
Output
1234
2.
Output
54321
3.
5.
Output:
12345
12345
STUDY GUIDE Module 6
1.
int myNum[5]={1,2,3,4,5};
int a=0;
a+=myNum[x];
cout<<a;
2.
int myNum[5]={1,2,3,4,5};
int a=0;
a+=myNum[x];
cout<<a;
3.
int myNum[5]={1,2,3,4,5};
int a=0;
a+=myNum[x];
cout<<a;
int a=0;
if(myNum[x]%2==0){
a+=myNum[x];
cout<<a;
5.
int myNum[10]={1,2,3,4,5,6,7,8,9,10};
int a=0;
if(myNum[x]%2=!0){
a++;
cout<<a;
2.
3.
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.