Computer Applications Detailed Notes
Computer Applications Detailed Notes
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.
3. Functions
6. JavaScript
7. Web Hosting
Databases store structured data. DBMS helps manage this data efficiently.
Tables: Made of rows and columns (like Excel).
Example:
```sql
CREATE TABLE student (id INT, name VARCHAR(20));
INSERT INTO student VALUES (1, 'Anu');
SELECT * FROM student WHERE id = 1;
```
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.
Practice Questions