Class 12 – Computer Applications (Commerce)
Detailed Exam Preparation Notes – SCERT Kerala
1. Review of C++ Programming
This unit refreshes core concepts of C++ learned in Class 11 and introduces additional
features.
Tokens are the building blocks of C++ programs:
- Keywords: Predefined words like `int`, `float`, `return`.
- Identifiers: User-defined names for variables/functions (e.g., `marks`, `calculate()`).
- Literals: Constants like `25`, `'A'`, `"Hello"`.
- Operators: Symbols for operations like `+`, `-`, `==`, `!=`.
- Punctuators: Syntax characters like `;`, `()`, `{}`.
Conditional operator (?:) It is a ternary operator of C++ and it requires three operands. It
can substitute if - else statement. The if - else statement used in Program 1.2 can be
replaced by the following: final_ce = (ce1>ce2) ? ce1 : ce2; If we have to find the largest
among three scores, nesting of conditional operator can be used as follows: final_ce =
(ce1>ce2) ? ((ce1>ce3)?ce1:ce3) : ((ce2>ce3)?ce2:ce3);
Data types are classified as fundamental (int, float) and derived (array, pointer, etc.).
Modifiers (`long`, `short`, `unsigned`) adjust the data range or size.
Control Structures:
- `if`, `if-else`, `else-if ladder`, `switch-case` for decision making.
- `for`, `while`, `do-while` for loops.
Jump statements
The statements that facilitate the transfer of program control from one place to
another are called jump statements. C++ provides four jump statements that perform
unconditional control transfer in a program. They are return, goto, break and continue
statements. All of these are keywords. In addition, C++ provides a standard library
function exit()that helps us to terminate a program.
- Jump statements like `break` (exit loop), `continue` (skip iteration), `goto` (jump), and
`return` (exit function).
Nested loops allow placing one loop inside another, like counting minutes and seconds
in a clock.
Let us write a program that requires the use of nested loops. Program 1.9 can display all
prime numbers below 100.
2. Arrays
Arrays store multiple values of the same type using one name. Useful for handling
listsog of items like scores.
Syntax: `int marks[5] = {10, 20, 30, 40, 50};`
Each value is accessed using an index: `marks[0]` to `marks[4]`.
Program 2.1 shows how to read 5 numbers and display them in the reverse order. The
program includes two for loops. The first one allows the user to input array values. After
five values have been entered, the second for loop is used to display the stored values
from the last to the first.
Traversal means processing each element (e.g., printing or summing).
String handling uses character arrays: `char name[] = "Anil";`
In C++, strings are terminated with a null character `\0`.
Use `gets()` or `getline()` for strings with spaces.
3. Functions
Functions help break large problems into smaller modules.
Types:
- Predefined (e.g., `sqrt()`, `strlen()`)
- User-defined: created by the programmer.
Structure:
```cpp
int sum(int a, int b) {
return a + b;
}
```
Variables have scope (local/global) and lifetime (temporary/permanent).
4 & 5. Web Technology and HTML
HTML creates the structure of web pages.
Basic tags:
- Structure: `<html>`, `<head>`, `<title>`, `<body>`
- Formatting: `<b>`, `<i>`, `<u>`, `<br>`, `<hr>`
- Lists: `<ul>`, `<ol>`, `<li>`
- Tables: `<table>`, `<tr>`, `<td>`, `<th>`
- Forms: `<form>`, `<input>`, `<textarea>`, `<button>`
HTML5 adds `<audio>`, `<video>`, `<section>`, `<article>` for richer pages.
6. JavaScript
JavaScript enables interactivity on websites (e.g., validation, dynamic changes).
Key features:
- Variables using `let`, `const`
- Data types: string, number, boolean
- DOM: Access HTML elements (e.g., `document.getElementById()`)
- Event handling: `onclick`, `onchange`, `onload`
7. Web Hosting
Web hosting allows your website to be available online.
- Free hosting (limited): WordPress.com, Blogger
- Paid hosting (full control): Bluehost, Hostinger
- CMS like WordPress help create websites without coding.
- Responsive design ensures the site works well on mobile/tablets.
8 & 9. Database and SQL
Databases store structured data. DBMS helps manage this data efficiently.
Tables: Made of rows and columns (like Excel).
SQL (Structured Query Language):
- CREATE TABLE, INSERT, SELECT, UPDATE, DELETE
- Conditions with WHERE, sorting with ORDER BY
- Views and Nested queries for advanced data retrieval
Example:
```sql
CREATE TABLE student (id INT, name VARCHAR(20));
INSERT INTO student VALUES (1, 'Anu');
SELECT * FROM student WHERE id = 1;
```
10. Enterprise Resource Planning (ERP)
ERP integrates business processes like HR, finance, inventory into one system.
- Benefits: Better coordination, central database
- Risks: Expensive, complex to implement
Popular packages: SAP, Oracle ERP, Microsoft Dynamics.
11. ICT Trends
- Mobile computing: Devices like smartphones, tablets
- Operating systems: Android, iOS
- Cybersecurity: Protect data from threats (viruses, phishing)
- E-commerce, online banking and digital payment (UPI, wallets)
Practice Questions
1. Write a C++ program to input 10 numbers and find their average.
2. Create an HTML page with your name, image, and contact info.
3. Write SQL queries to insert and retrieve student data.
4. Differentiate between:
- break vs continue
- static vs dynamic web pages
- local vs global variables