Welcome to Kerala Study Hub (keralastudyhub.in), your complete online resource for SCERT Kerala and DHSE Higher Secondary examinations. If you are a Class 12 (Plus Two) Commerce or Humanities student (or a Plus Two Computer Science student) searching for Kerala Plus Two Computer Application Chapter 1 Notes: Review of C++ Programming and Chapter 2: Arrays (C++ പ്രോഗ്രാമിംഗ് റിവ്യൂവും അറേകളും), this master study guide covers every concept, syntax rule, loop conversion, and output prediction question you need for the board exam.
- 1. Chapter Weightage & Exam Blueprint (DHSE Plus Two Computer Application)
- 2. Chapter 1: Review of C++ Programming (C++ പ്രോഗ്രാമിംഗ് — ഒരു പുനരവലോകനം)
- 2.1 Character Set & Tokens in C++ (ക്യാരക്ടർ സെറ്റും ടോക്കണുകളും — Sure 2 or 3 Marks)
- 2.2 Operators in C++ & Important Exam Distinctions
- 2.3 Fundamental Data Types & Type Conversion in C++ (ഡാറ്റാ ടൈപ്പുകളും ടൈപ്പ് കൺവേർഷനും)
- 2.4 Control Statements in C++ (നിയന്ത്രണ പ്രസ്താവനകൾ — Guaranteed 5 to 8 Marks)
- 3. Chapter 2: Arrays in C++ (അറേകൾ — Arrays & String Handling)
- 3.1 What is an Array? Declaration, Initialisation & Memory Calculation
- 3.2 Array Traversal & Important C++ Array Programs
- 3.3 String Handling Using Character Arrays (സ്ട്രിംഗ് കൈകാര്യം ചെയ്യൽ — Sure 3 Marks)
- 4. 30 Solved DHSE Kerala Board Exam Questions & Answers (1, 2, 3, 4, 5 & 8 Marks)
- Part 1: 1-Mark Objective Questions (Q1 to Q10)
- Part 2: 2-Mark Short Answer Questions (Q11 to Q18)
- Part 3: 3-Mark Code Conversion & Output Questions (Q19 to Q25)
- Part 4: 4-Mark & 5-Mark Questions & C++ Programs (Q26 to Q28)
- Part 5: 8-Mark Long Essay Questions (Q29 & Q30)
- 5. D+ (Just Pass / 30% Minimum Rule) Capsule & Sure A+ Revision Box
- 6. Teacher’s Corner: SCERT Scheme of Work, Learning Outcomes & C++ Practical Lab Guide (അധ്യാപകർക്കായി)
- 7. Popular Search Queries by Kerala Students & Teachers (SEO Keyword Index)
In the DHSE Kerala Plus Two Computer Application examination (60 Marks Theory + 20 Marks Practical + 20 Marks CE), C++ Programming and Arrays form the backbone of both the written paper and the practical lab exam. Many Commerce and Humanities students find C++ syntax, loop conversions, and array indexing challenging. That is why we have prepared this Simple English + Malayalam Medium (മലയാളം മീഡിയം) guide with clear comparison tables, step-by-step C++ loop conversions (for, while, do...while), array memory allocation calculations, solved textbook questions, a Teacher’s Practical Lab & Scheme of Work Corner, and 30 solved DHSE board exam questions.
1. Chapter Weightage & Exam Blueprint (DHSE Plus Two Computer Application)
Checking the marks distribution of Chapter 1 (Review of C++ Programming) and Chapter 2 (Arrays) helps you focus on the exact question patterns asked in the Onam Exam, Christmas Exam, Model Exam, and March DHSE Board Exam.
| Feature / Exam Parameter | Chapter 1: Review of C++ Programming | Chapter 2: Arrays in C++ |
|---|---|---|
| Malayalam Title (മലയാളം) | C++ പ്രോഗ്രാമിംഗ് — ഒരു പുനരവലോകനം | അറേകൾ (Arrays) |
| Board Exam Marks Weightage | 7 to 8 Marks (out of 60 Marks Theory) | 5 to 6 Marks (out of 60 Marks Theory) |
| Combined Weightage (Ch 1 + Ch 2) | 12 to 14 Marks in Written Theory + 10 Marks in C++ Practical Lab Exam! | |
| Most Repeated Question Types | • Tokens & Identifier Rules (2 Marks) • Type Conversion — Implicit vs Explicit (2/3 Marks) • Entry vs Exit Controlled Loops (3 Marks) • Loop Conversion ( for ⇔ while ⇔ do...while) (3 Marks)• switch vs else if & break vs continue (3 Marks) |
• Array Definition & Declaration Syntax (2 Marks) • Memory Allocation Byte Calculation (2 Marks) • Array Traversal using for loop (3 Marks)• String Input: cin vs gets() / getline() & Null Character '�' (3 Marks) |
Explore Related Plus Two & Plus One Guides on Kerala Study Hub:
- Kerala Plus One Computer Application Chapter 1 Notes: Fundamentals of Computer
- Kerala Plus Two Business Studies Chapter 1 Notes: Nature and Significance of Management
- Kerala Plus Two Accountancy Chapter 1 Notes: Accounting for Partnership — Basic Concepts
- Kerala Plus Two Economics Chapter 1 Notes: Introduction to Microeconomics & Macroeconomics
- Kerala Plus Two English Chapter 1 Notes: The 3Ls of Empowerment
2. Chapter 1: Review of C++ Programming (C++ പ്രോഗ്രാമിംഗ് — ഒരു പുനരവലോകനം)
2.1 Character Set & Tokens in C++ (ക്യാരക്ടർ സെറ്റും ടോക്കണുകളും — Sure 2 or 3 Marks)
The Character Set of C++ is the set of valid characters that the C++ language can recognise: Letters (A–Z, a–z), Digits (0–9), Special Characters (+ - * / ^ \ ( ) [ ] { } = != < > . , ; : ' " # % & _), and White Spaces (Space, Tab, Newline).
What are Tokens in C++? (എന്താണ് ടോക്കണുകൾ?):
Tokens are the fundamental building blocks (അടിസ്ഥാന ഘടകങ്ങൾ) or smallest individual lexical units of a C++ program. C++ has Five Types of Tokens (5 തരം ടോക്കണുകൾ):
- Keywords (കീവേഡുകൾ / സംവരണ പദങ്ങൾ):
- Keywords are reserved words that convey a predefined special meaning to the C++ compiler.
- All C++ keywords must be written in lowercase letters, and they cannot be used as variable names.
- Examples:
int,float,char,double,void,if,else,switch,case,default,for,while,do,break,continue,return,const,signed,unsigned.
- Identifiers (ഐഡന്റിഫയറുകൾ):
- Identifiers are user-defined names given to variables, arrays, functions, classes, and objects.
- 5 Strict Rules for Naming Valid Identifiers in C++ (Exam Favourite 2-Mark Question):
- An identifier can contain only alphabets (
A–Z, a–z), digits (0–9), and the underscore (_) character. - The first character MUST be a letter or an underscore (
_)—it can NEVER start with a digit (e.g.,mark1and_totalare valid, but1markis INVALID). - White spaces and special symbols (like
@,-,.,#) are NOT allowed (e.g.,total markandnet-payare INVALID;total_markis VALID). - C++ Keywords cannot be used as identifiers (e.g.,
floatorforis INVALID). - Upper-case and lower-case letters are treated differently because C++ is Case-Sensitive (
Sum,sum, andSUMare three different identifiers).
- An identifier can contain only alphabets (
- Literals / Constants (ലിറ്ററലുകൾ / സ്ഥിരമൂല്യങ്ങൾ):
- Data items whose values never change during program execution.
- Four Types of Literals:
- (a) Integer Literals: Whole numbers without fractional parts (e.g.,
100,-45,0). - (b) Floating-point (Real) Literals: Numbers having fractional parts in decimal or exponential form (e.g.,
3.14,-0.75,2.5E4). - (c) Character Literals: A single character enclosed in single quotes (
' ') (e.g.,'A','9','$') or Escape Sequences like'(Newline),
'' '(Horizontal Tab), and'�'(Null character). - (d) String Literals: A sequence of one or more characters enclosed in double quotes (
" ") (e.g.,"Kerala","A"). Note that every string literal automatically ends with a hidden null character'�', so"A"occupies 2 Bytes (`’A’` + `’�’`), whereas'A'occupies 1 Byte!
- (a) Integer Literals: Whole numbers without fractional parts (e.g.,
- Punctuators / Separators (പങ്ച്വേറ്ററുകൾ): Special symbols used for syntactic grouping and separation:
{ },( ),[ ],;(statement terminator),,,:,#(preprocessor directive). - Operators (ഓപ്പറേറ്ററുകൾ): Symbols that instruct the compiler to perform specific mathematical or logical operations on operands.
2.2 Operators in C++ & Important Exam Distinctions
| Operator Category | Symbols Used | Key Exam Rules & Examples |
|---|---|---|
| 1. Arithmetic Operators (ഗണിത ഓപ്പറേറ്ററുകൾ) |
+, -, *, /, % |
• Modulus Operator (%): Gives the remainder of integer division (e.g., 17 % 5 = 2; 10 % 2 = 0). Note: % works ONLY with integer operands, never with float!• Integer division truncates decimals: 7 / 2 = 3, whereas 7.0 / 2 = 3.5. |
| 2. Relational Operators (താരതമ്യ ഓപ്പറേറ്ററുകൾ) |
<, >, <=, >=, ==, != |
• Used to compare two values; result is always either 1 (True) or 0 (False).• == tests equality, whereas = is the assignment operator! |
| 3. Logical Operators (ലോജിക്കൽ ഓപ്പറേറ്ററുകൾ) |
&& (AND), || (OR), ! (NOT) |
• && is True only if BOTH conditions are True.• || is True if AT LEAST ONE condition is True.• ! is a Unary operator that reverses True (1) to False (0) and vice versa. |
4. Increment (++) & Decrement (--) Operators |
++x, x++, --x, x-- |
• Prefix (++x — Change then Use): First increments x by 1, then uses the new value.• Postfix ( x++ — Use then Change): First uses the current value of x in the expression, then increments x by 1. |
5. Conditional / Ternary Operator (? :) |
Condition ? Exp1 : Exp2; |
• The ONLY Ternary Operator in C++ (requires 3 operands). Acts as a shortcut for if...else.• Example: big = (a > b) ? a : b; |
6. Input (>>) & Output (<<) Operators |
>> (Extraction)<< (Insertion) |
• cin >> x; uses the Extraction / Get from operator (>>).• cout << x; uses the Insertion / Put to operator (<<).•Cascading of I/O operators means using multiple << or >> in a single statement (e.g., cout << a << b;). |
2.3 Fundamental Data Types & Type Conversion in C++ (ഡാറ്റാ ടൈപ്പുകളും ടൈപ്പ് കൺവേർഷനും)
5 Fundamental (Built-in) Data Types in C++ (GCC Compiler Memory Size):
void(0 Bytes): Represents an empty set of data (used for functions that do not return a value or generic pointers).char(1 Byte): Stores a single character (e.g.,char grade = 'A';).int(4 Bytes): Stores whole numbers / integers without decimals (e.g.,int roll = 25;).float(4 Bytes): Stores single-precision floating-point numbers with up to ~7 digits of precision (e.g.,float avg = 85.5;).double(8 Bytes): Stores double-precision floating-point numbers with ~15 digits of precision.
Type Conversion (ടൈപ്പ് കൺവേർഷൻ — Sure 2 or 3 Marks): Converting one predefined data type into another in a mixed-mode expression is called Type Conversion. It is of two types:
- Implicit Type Conversion (Type Promotion / തനിയെ നടക്കുന്ന പരിവർത്തനം):
- Performed automatically by the C++ compiler without any programmer intervention.
- Follows the rule of Type Promotion—the compiler converts the lower-sized data type into the higher-sized data type in the expression (
char ⇒ int ⇒ float ⇒ double) to prevent data loss. - Example: In
int a = 5; float b = 2.5, c; c = a + b;, integera (5)is automatically promoted tofloat (5.0)and the result is7.5 (float).
- Explicit Type Conversion (Type Casting / പ്രോഗ്രാമർ നിർബന്ധപൂർവ്വം നടത്തുന്ന പരിവർത്തനം):
- Performed explicitly (forcefully) by the programmer by specifying the target data type in parentheses before the expression.
- Example:
int a = 7, b = 2; float res = (float)a / b;gives3.5instead of3.
2.4 Control Statements in C++ (നിയന്ത്രണ പ്രസ്താവനകൾ — Guaranteed 5 to 8 Marks)
Control statements alter the normal sequential (top-to-bottom) flow of execution in a program. They are classified into two major groups: (A) Decision Making / Selection Statements and (B) Iteration / Looping Statements (plus Jump Statements).
A. Selection / Decision Statements: if, if...else, else if ladder, and switch...case
Comparison between switch...case and else if ladder (Sure 3-Mark Question):
| Feature | switch...case Statement |
else if ladder Statement |
|---|---|---|
| 1. Type of Condition Tested | Tests ONLY for equality (==) against discrete constant values. |
Can evaluate any relational or logical expression (<, >, ranges like mark >= 90 && mark <= 100). |
| 2. Data Types Allowed | Works ONLY with int and char constants (never with float or string!). |
Works with all data types including int, char, float, and double. |
| 3. Default Fallback | If no case matches, the default block executes. |
If no condition is true, the final else block executes. |
4. Role of break |
Requires break; after each case to prevent “fall-through” execution. |
Does not require break;—exits automatically once a true block executes. |
B. Iteration / Looping Statements (ആവർത്തന പ്രസ്താവനകൾ / ലൂപ്പുകൾ)
Every loop in C++ consists of Four Essential Elements (ലൂപ്പിന്റെ 4 പ്രധാന ഭാഗങ്ങൾ — Sure 2 Marks):
- Initialisation (പ്രാരംഭ മൂല്യം നൽകൽ): Setting the starting value of the loop control variable before the loop starts (e.g.,
i = 1;). - Test Expression / Condition (നിബന്ധന പരിശോധിക്കൽ): A relational condition checked to decide whether to execute the loop body (e.g.,
i <= 10;). - Body of the Loop (ലൂപ്പ് ബോഡി): The set of statements executed repeatedly as long as the condition is true.
- Update Expression (മൂല്യം പുതുക്കൽ): Incrementing or decrementing the loop control variable after each iteration (e.g.,
i++ori = i + 2).
Master Comparison: Entry-Controlled Loops (for, while) vs Exit-Controlled Loop (do...while) (Sure 3 or 4 Marks):
| Basis of Comparison | Entry-Controlled Loop (എൻട്രി കൺട്രോൾഡ് ലൂപ്പ്) e.g., for loop & while loop |
Exit-Controlled Loop (എക്സിറ്റ് കൺട്രോൾഡ് ലൂപ്പ്) e.g., do...while loop |
|---|---|---|
| 1. When is Condition Checked? | Test condition is checked at the beginning (before entering the loop body). | Test condition is checked at the end (after executing the loop body once). |
| 2. Execution if Condition is Initially False | The loop body will NOT execute even once (Minimum execution = 0 times). | The loop body executes AT LEAST ONCE (Minimum execution = 1 time) even if the condition is false! |
3. Semicolon at End of while |
No semicolon after while(condition) or for(...) header. |
Ends with a mandatory semicolon: do { ... } while(condition);. |
Side-by-Side Loop Conversion Template (ഏത് ലൂപ്പും പരസ്പരം മാറ്റാൻ — Guaranteed 3-Mark Board Question!)
Suppose we want to print numbers from 1 to 5. Observe how the exact same logic is written in all three loops:
1. Using for Loop |
2. Equivalent while Loop |
3. Equivalent do...while Loop |
|---|---|---|
int i;
for(i = 1; i <= 5; i++)
{
cout << i << " ";
}
|
int i = 1;
while(i <= 5)
{
cout << i << " ";
i++;
}
|
int i = 1;
do
{
cout << i << " ";
i++;
} while(i <= 5);
|
C. Jump Statements: break vs continue (Sure 3 Marks)
| Feature | break Statement |
continue Statement |
|---|---|---|
| 1. Core Function | Immediately terminates the entire loop (or switch) and transfers control to the statement outside the loop. |
Skips only the remaining statements of the current iteration and jumps to the next iteration of the loop. |
| 2. Where Can It Be Used? | Used inside both Loops (for, while, do...while) AND switch statements. |
Used ONLY inside Loops (never inside switch alone). |
3. Output Examplefor(i=1; i<=5; i++){ if(i==3) [stmt]; cout<<i; } |
With break; ⇒ Output is: 1 2 (stops completely when i becomes 3). |
With continue; ⇒ Output is: 1 2 4 5 (skips only 3 and continues with 4 and 5). |
3. Chapter 2: Arrays in C++ (അറേകൾ — Arrays & String Handling)
3.1 What is an Array? Declaration, Initialisation & Memory Calculation
- Definition (അറേ നിർവചനം): An Array is a collection of elements of the same data type (ഒരേ ഡാറ്റാ ടൈപ്പിലുള്ള ഘടകങ്ങളുടെ കൂട്ടം / Homogeneous data) stored in contiguous (continuous) memory locations and referred to by a single common variable name.
- Array Index / Subscript: Each element in an array is accessed using its position number called the Index or Subscript enclosed in square brackets
[ ]. In C++, array indexing ALWAYS starts from0and ends atSize − 1! - Syntax for Declaring a 1D Array:
data_type array_name[size];
Examples:
•int score[5];— Declares an integer array namedscorethat can hold 5 integers fromscore[0]toscore[4].
•int num[5] = {10, 20, 30, 40, 50};— Array initialisation at the time of declaration. Here,num[0] = 10,num[2] = 30, andnum[4] = 50.
Formula for Calculating Memory Occupied by an Array (Sure 1 or 2 Marks in Exam):
Total Memory (in Bytes) = Size of Data Type (in Bytes) × Number of Elements in Array
| Array Declaration Statement | Size of Data Type (GCC) | Number of Elements | Total Memory Allocated (Bytes) |
|---|---|---|---|
char name[25]; |
char = 1 Byte |
25 | 1 × 25 = 25 Bytes |
int mark[10]; |
int = 4 Bytes |
10 | 4 × 10 = 40 Bytes |
float price[8]; |
float = 4 Bytes |
8 | 4 × 8 = 32 Bytes |
double salary[5]; |
double = 8 Bytes |
5 | 8 × 5 = 40 Bytes |
3.2 Array Traversal & Important C++ Array Programs
What is Array Traversal? (എന്താണ് അറേ ട്രാവേഴ്സൽ?):
Accessing each element of an array at least once from the first element to the last element to perform an operation (such as reading elements, displaying elements, finding the sum, or searching an element) is called Array Traversal.
Standard C++ Program 1: Read 5 Numbers into an Array and Display Their Sum & Reverse Order
#include <iostream>
using namespace std;
int main()
{
int arr[5], i, sum = 0;
cout << "Enter 5 numbers: ";
for(i = 0; i < 5; i++)
{
cin >> arr[i];
sum = sum + arr[i];
}
cout << "Sum of elements = " << sum << endl;
cout << "Elements in reverse order: ";
for(i = 4; i >= 0; i--)
{
cout << arr[i] << " ";
}
return 0;
}
3.3 String Handling Using Character Arrays (സ്ട്രിംഗ് കൈകാര്യം ചെയ്യൽ — Sure 3 Marks)
- In C++, a String is treated as a one-dimensional array of characters (
chararray) automatically terminated by a special Null Character ('�') whose ASCII value is0. - For example, if we declare
char str[] = "KERALA";, the wordKERALAhas 6 letters, so the array actually stores 7 characters in memory:'K', 'E', 'R', 'A', 'L', 'A', '�'(Total = 7 Bytes). - Why
gets()is preferred overcin >>for reading Strings (Very Important 2-Mark Question!):- When reading a string using
cin >> str;, the extraction operator treats a blank space (white space) as a string terminator. So if you type"New Delhi",cinwill read only"New"and ignore"Delhi"! - To read a multi-word string containing white spaces (like full names or addresses), we use the
gets(str);function (contained in the<cstdio>header file) orcin.getline(str, size);. Similarly,puts(str);is used to display a string on the monitor followed by a newline.
- When reading a string using
4. 30 Solved DHSE Kerala Board Exam Questions & Answers (1, 2, 3, 4, 5 & 8 Marks)
Part 1: 1-Mark Objective Questions (Q1 to Q10)
Q1. The fundamental building blocks of a C++ program are called __________. (C++ പ്രോഗ്രാമിന്റെ അടിസ്ഥാന ഘടകങ്ങളെ __________ എന്ന് വിളിക്കുന്നു.)
Ans: Tokens (ടോക്കണുകൾ).
Q2. Which operator in C++ gives the remainder of an integer division?
Ans: Modulus operator (%).
Q3. Name the only ternary operator available in C++.
Ans: Conditional operator (? :).
Q4. Which loop in C++ is an Exit-Controlled Loop? (C++ ലെ എക്സിറ്റ് കൺട്രോൾഡ് ലൂപ്പ് ഏതാണ്?)
Ans: do...while loop.
Q5. What is the minimum number of times the body of a do...while loop executes?
Ans: 1 time (At least once).
Q6. What is the subscript (index) of the first and last element of the array int num[20];?
Ans: First element index = 0 (num[0]); Last element index = 19 (num[19]).
Q7. How many bytes of memory will be allocated for the array int score[15]; in GCC compiler?
Ans: 4 Bytes × 15 = 60 Bytes.
Q8. Which character is automatically appended at the end of every string in C++?
Ans: Null character ('�').
Q9. Which header file is required to use gets() and puts() functions in C++?
Ans: <cstdio> (or stdio.h).
Q10. Accessing each element of an array at least once is known as __________.
Ans: Array Traversal (അറേ ട്രാവേഴ്സൽ).
Part 2: 2-Mark Short Answer Questions (Q11 to Q18)
Q11. Identify the invalid identifiers from the following list and give reasons: Total_Mark, 2ndRank, float, my name, _count.
Ans:
• 2ndRank — Invalid: Starts with a digit.
• float — Invalid: It is a C++ keyword.
• my name — Invalid: Contains a blank space.
(Total_Mark and _count are valid identifiers.)
Q12. Differentiate between 'A' and "A" in C++.
Ans: 'A' is a single character literal enclosed in single quotes and occupies 1 Byte of memory. "A" is a string literal enclosed in double quotes that automatically contains the null character ('A' + '�') and occupies 2 Bytes of memory.
Q13. Predict the output of the following C++ code snippet:
int a = 10, b; b = a++; cout << a << " " << b;
Ans: Since a++ is postfix increment (use then change), b receives the old value 10 first, and then a becomes 11. Output: 11 10.
Q14. Rewrite the following if...else statement using the Conditional Operator (? :):
if (mark >= 30)
cout << "Passed";
else
cout << "Failed";
Ans:
cout << ((mark >= 30) ? "Passed" : "Failed"); (or (mark >= 30) ? cout << "Passed" : cout << "Failed";).
Q15. What are the four main components of a loop in C++? (ഒരു ലൂപ്പിന്റെ 4 പ്രധാന ഭാഗങ്ങൾ ഏവ?)
Ans: (1) Initialisation expression, (2) Test expression (Condition), (3) Body of the loop, and (4) Update expression.
Q16. Find the memory allocated (in bytes) for the following declarations in GCC: (a) float rate[10];, (b) char str[] = "WELCOME";.
Ans:
• (a) float rate[10]; = 4 Bytes × 10 = 40 Bytes.
• (b) char str[] = "WELCOME"; = 7 letters + 1 Null character ('�') = 8 Bytes.
Q17. Given the array int A[5] = {12, 25, 30, 45, 50};. Find the value of A[1] + A[3] and A[4] - A[0].
Ans:
Here, A[0]=12, A[1]=25, A[2]=30, A[3]=45, A[4]=50.
• A[1] + A[3] = 25 + 45 = 70.
• A[4] - A[0] = 50 − 12 = 38.
Q18. Why is gets() preferred over cin >> while reading a string in C++?
Ans: The cin >> operator stops reading a string as soon as it encounters a blank space (white space), so it can read only a single word. The gets() function can read an entire multi-word string including white spaces until the Enter key is pressed.
Part 3: 3-Mark Code Conversion & Output Questions (Q19 to Q25)
Q19. Convert the following for loop into a while loop and a do...while loop:
for (int k = 10; k >= 2; k = k - 2)
{
cout << k << "
";
}
Ans:
• Equivalent while loop:
int k = 10;
while (k >= 2)
{
cout << k << "
";
k = k - 2;
}
• Equivalent do...while loop:
int k = 10;
do
{
cout << k << "
";
k = k - 2;
} while (k >= 2);
Q20. Convert the following else if ladder into a switch...case statement:
if (ch == 'R' || ch == 'r')
cout << "Red";
else if (ch == 'G' || ch == 'g')
cout << "Green";
else if (ch == 'B' || ch == 'b')
cout << "Blue";
else
cout << "Invalid Colour";
Ans:
switch (ch)
{
case 'R':
case 'r': cout << "Red"; break;
case 'G':
case 'g': cout << "Green"; break;
case 'B':
case 'b': cout << "Blue"; break;
default : cout << "Invalid Colour";
}
Q21. Compare Entry-Controlled Loops and Exit-Controlled Loops with examples. (എൻട്രി കൺട്രോൾഡ് ലൂപ്പും എക്സിറ്റ് കൺട്രോൾഡ് ലൂപ്പും താരതമ്യം ചെയ്യുക.)
Ans: (Refer to the 3-point comparison table in Section 2.4-B: Entry-controlled loops [for, while] check condition at the top and execute 0 times if initially false; Exit-controlled loop [do...while] checks condition at the bottom and executes at least once even if initially false.)
Q22. Distinguish between break and continue statements in C++ with an example.
Ans: (Refer to the comparison table in Section 2.4-C: break terminates the entire loop/switch immediately, whereas continue skips only the rest of the current iteration and continues with the next iteration.)
Q23. Differentiate between Implicit Type Conversion and Explicit Type Conversion in C++.
Ans: (Refer to Section 2.3: Implicit conversion [Type Promotion] is done automatically by the compiler from lower to higher data type; Explicit conversion [Type Casting] is forced by the programmer using type cast syntax.)
Q24. Predict the output of the following two C++ code fragments and explain the difference:
Fragment A: int i = 10; while(i < 5) { cout << i; i++; }
Fragment B: int i = 10; do { cout << i; i++; } while(i < 5);
Ans:
• Output of Fragment A: No output (because while is an entry-controlled loop and the condition 10 < 5 is false at the beginning).
• Output of Fragment B: 10 (because do...while is an exit-controlled loop, so it prints 10 once before checking the false condition 11 < 5).
Q25. Explain how to declare and initialise a 1D array in C++ with examples.
Ans: A 1D array is declared using data_type array_name[size]; (e.g., int age[5];). It can be initialised at the time of declaration by enclosing comma-separated values inside curly braces: int age[5] = {16, 17, 18, 17, 16};.
Part 4: 4-Mark & 5-Mark Questions & C++ Programs (Q26 to Q28)
Q26. Explain the five types of Tokens in C++ with suitable examples. (C++ ലെ 5 തരം ടോക്കണുകൾ ഉദാഹരണസഹിതം വിവരിക്കുക.) [5 Marks]
Ans: (Explain the 5 tokens from Section 2.1: 1. Keywords, 2. Identifiers, 3. Literals [Integer, Float, Character, String], 4. Punctuators, and 5. Operators.)
Q27. Compare switch...case statement and else if ladder in C++. [4 Marks]
Ans: (Reproduce the 4-point comparison table from Section 2.4-A.)
Q28. Write a C++ program to input the marks of 10 students into an array and find the highest (largest) mark among them. [5 Marks]
Ans:
#include <iostream>
using namespace std;
int main()
{
int mark[10], i, big;
cout << "Enter marks of 10 students: ";
for(i = 0; i < 10; i++)
{
cin >> mark[i];
}
big = mark[0];
for(i = 1; i < 10; i++)
{
if(mark[i] > big)
big = mark[i];
}
cout << "Highest Mark = " << big;
return 0;
}
Part 5: 8-Mark Long Essay Questions (Q29 & Q30)
Q29. (Essay 1) Explain the three looping statements in C++ (for, while, and do...while) with their syntax, working, and examples. Also classify them into Entry-Controlled and Exit-Controlled loops. [8 Marks]
Ans: (Provide the definition of looping, the 4 elements of a loop [Initialisation, Condition, Body, Update], the syntax and working of for, while, and do...while from Section 2.4-B, and the Entry vs Exit controlled comparison table.)
Q30. (Essay 2) What is an Array? Explain 1D array declaration, initialisation, memory allocation calculation, and array traversal with a complete C++ program to find the sum and average of N numbers using an array. [8 Marks]
Ans: (Define Array from Section 3.1, explain 0-based indexing, memory allocation formula Bytes = sizeof(type) × size, array traversal from Section 3.2, and write the C++ program to read array elements and calculate their sum and average.)
5. D+ (Just Pass / 30% Minimum Rule) Capsule & Sure A+ Revision Box
5 Must-Learn Points for Easy Pass (പ്ലസ് ടു കമ്പ്യൂട്ടർ ആപ്ലിക്കേഷൻ എളുപ്പത്തിൽ ജയിക്കാൻ):
- 5 Tokens in C++: Keywords, Identifiers, Literals, Punctuators, Operators.
- 4 Parts of a Loop: Initialisation, Test Condition, Body of Loop, Update Statement.
- Entry vs Exit Loop:
forandwhile= Entry-Controlled (min execution = 0);do...while= Exit-Controlled (min execution = 1). breakvscontinue:breakexits the whole loop;continueskips only the current iteration.- Array Memory Formula:
char = 1 Byte,int = 4 Bytes,float = 4 Bytes,double = 8 Bytes. Multiply by array size!
6. Teacher’s Corner: SCERT Scheme of Work, Learning Outcomes & C++ Practical Lab Guide (അധ്യാപകർക്കായി)
For Kerala Higher Secondary Computer Application Teachers planning classroom sessions and C++ practical lab records:
| Teaching Parameter | DHSE / SCERT Curriculum Guidelines |
|---|---|
| Allotted Month & Periods | June (Ch 1 Review of C++: 10 Theory + 6 Lab Periods; Ch 2 Arrays: 8 Theory + 6 Lab Periods). |
| Core Learning Outcomes (പഠനനേട്ടങ്ങൾ) | • Identifies C++ tokens and applies operators and type conversions accurately. • Converts programs across for, while, and do...while loops.• Declares 1D arrays, calculates memory allocation, and writes C++ programs for array traversal and string I/O. |
| Mandatory Practical Lab Programs (Geany IDE / GCC) | 1. C++ Program to check whether a number is Prime or Palindrome using a loop. 2. C++ Program to input N numbers into an array and find the largest/smallest element.3. C++ Program to check whether a string is a Palindrome or count vowels in a string using a character array. |
7. Popular Search Queries by Kerala Students & Teachers (SEO Keyword Index)
This study material directly addresses the most popular search queries by Kerala Class 12 students and teachers:
- Student Search Keywords: Kerala Plus Two Computer Application Chapter 1 Review of C++ Notes PDF, Plus Two Computer Application Chapter 2 Arrays Notes Malayalam Medium, പ്ലസ് ടു കമ്പ്യൂട്ടർ ആപ്ലിക്കേഷൻ അധ്യായം 1 നോട്സ് ചോദ്യോത്തരങ്ങൾ, Plus Two Computer Application Loop Conversion Questions and Answers, Entry Controlled vs Exit Controlled Loop Malayalam Notes, Plus Two Computer Application Practical Lab Programs PDF, Plus Two Commerce Computer Application Sure A+ Notes by Anagh R K Reference.
- Teacher Search Keywords: DHSE Kerala Plus Two Computer Application Scheme of Work and Chapter Weightage, Plus Two Computer Application Teaching Manual and Lab Record Guidelines.
Check out our other Master Exam Guides on Kerala Study Hub:
- Kerala Vijayabheri, SMILE & Orukkam Study Material PDF Download
- Kerala SSLC, Plus One & Plus Two Previous Year Question Papers & Answer Keys PDF
- Kerala SSLC, Plus One & Plus Two Exam Timetable
- Kerala SSLC & Plus Two Grading System, Grace Marks & Pass Marks Calculator Guide
Latest SCERT & DHSE Kerala Study Notes
- Kerala Class 9 Physics Chapter 2 Notes: Equations of Motion (ചലനസമവാക്യങ്ങൾ) Std 9 Let Us Assess Questions and Answers PDF
- Kerala SSLC Christmas Exam Question Paper 2025-27: All Subjects Second Term & Model Question Papers with Solved Answer Keys PDF (New SCERT Syllabus)
- Kerala SSLC English Christmas Exam Question Paper 2025-27: Second Term & Model Solved 80-Mark Answer Key, Discourses & Grammar PDF
- Kerala SSLC Social Science Christmas Exam Question Paper 2025-27: Second Term & Model Solved 80-Mark Answer Key, Weightage & Map Study PDF
- Kerala SSLC Maths Christmas Exam Question Paper 2025-27: Second Term & Model Solved Answer Key, Weightage & Formula Sheet PDF (New SCERT Syllabus)
- Kerala SSLC Biology Christmas Exam Question Paper 2025-27: Second Term & Model Solved Answer Key, Weightage & Flowcharts PDF (New SCERT Syllabus)
- Kerala SSLC Chemistry Christmas Exam Question Paper 2025-27: Second Term & Model Solved Answer Key, Weightage & Sure A+ Questions PDF (New SCERT Syllabus)
- Kerala SSLC Physics Christmas Exam Question Paper 2025-27: Second Term & Model Solved Answer Key, Weightage & Formula Sheet PDF (New SCERT Syllabus)





