Here are the important short and long questions of Unit 8, Entrepreneurship in Digital Age, from the Federal Board (FBISE) 2nd Year Computer Science course (HSSC-II, Intermediate Part II), solved in full for the Annual Examination 2027.
| Unit | 8: Entrepreneurship in Digital Age |
|---|---|
| Class | 2nd Year (HSSC-II), Federal Board |
| Subject | Computer Science |
| Contents | Short and long questions with answers |
| Exam | FBISE Annual Examination 2027 |
Short Questions with Answers: Unit 8
No questions from these papers.
Other Topics (Old Curriculum 2009, C++)
Q1. Why is memory management required? Give any three reasons. [Model Paper (Old Curriculum 2009)] (03)
Answer:
-
Allocation of memory to processes: each program needs memory to run; memory management allocates and deallocates memory efficiently as processes start and finish.
-
Protection: it keeps each process in its own memory space, so one process cannot access or corrupt another’s memory or the OS.
-
Efficient use and multitasking: it lets many programs run together, reduces fragmentation and uses virtual memory (paging) to run programs larger than physical RAM.
Q2. Write down any three differences between process and thread. [Model Paper (Old Curriculum 2009)] (03)
Answer:
| Process | Thread |
|---|---|
| A program in execution; an independent unit | A lightweight unit of execution within a process |
| Has its own separate memory space (address space) | Shares the memory and resources of its process |
| Creation and context switching are slow (heavy) | Creation and switching are fast (light) |
| Communication between processes is difficult (IPC) | Threads communicate easily through shared memory |
Q3. Write down the reasons of the following invalid variable names: (a) 3a (b) S$ (c) long [Model Paper (Old Curriculum 2009)] (03)
Answer:
-
(a) 3a: invalid because a variable name cannot start with a digit; it must begin with a letter or underscore.
-
(b) S$: invalid because special characters like $ are not allowed; only letters, digits and underscore are permitted.
-
(c) long: invalid because it is a reserved keyword (a data type) in C++ and cannot be used as an identifier.
Q4. Differentiate between unary and binary operators with one example each. [Model Paper (Old Curriculum 2009)] (03)
Answer:
| Unary operator | Binary operator |
|---|---|
| Works on one operand | Works on two operands |
| e.g. increment ++, decrement –, unary minus β, logical NOT ! | e.g. arithmetic +, β, *, /, %; relational <, >; logical && |
| Example: x++; or βa | Example: a + b; or x > y |
Q5. Write down any three differences between text and binary files. [Model Paper (Old Curriculum 2009)] (03)
Answer:
| Text file | Binary file |
|---|---|
| Data stored as readable characters (ASCII) | Data stored in binary (machine) format |
| Can be read and edited in any text editor | Cannot be read by a text editor |
| Character conversions (newline) take place; takes more space | No conversions; takes less space, faster access |
Q6. How is constructor different from destructor? List down any three differences. [Model Paper (Old Curriculum 2009)] (03)
Answer:
| Constructor | Destructor |
|---|---|
| Special member function that initialises an object | Special member function that destroys/cleans up an object |
| Called automatically when the object is created | Called automatically when the object goes out of scope or is deleted |
| Same name as class, e.g. Student() | Same name preceded by a tilde, e.g. ~Student() |
| Can have parameters and can be overloaded | Has no parameters and cannot be overloaded |
Q7. Write down any three responsibilities of system analyst. [Model Paper (Old Curriculum 2009)] (03)
Answer:
-
Studying the existing system and gathering requirements through interviews, questionnaires and observation of users.
-
Analysing problems and doing a feasibility study: identifying needs and proposing technical, economic and operational solutions.
-
Designing the new system and communicating: preparing specifications (DFDs, flowcharts) for programmers, coordinating between users and developers, and helping with testing, implementation and training.
Q8. Write down any three objectives of SDLC. [Model Paper (Old Curriculum 2009)] (03)
Answer:
-
To develop a high-quality system that meets user requirements, is correct and reliable.
-
To complete the project within time and budget through proper planning and control of each phase.
-
To provide a systematic, structured approach: clear phases, documentation and easy maintenance, which reduces risks and errors.
Q9. What will be displayed after executing the following statements? [Model Paper (Old Curriculum 2009)] (03)
int x = 3, y = 17;
cout << x / y << “t” << y / x << “t” << x % y;
Answer:
-
x / y = 3 / 17 = 0 (integer division)
-
y / x = 17 / 3 = 5 (integer division)
-
x % y = 3 % 17 = 3 (remainder)
-
Output: 0 5 3 (separated by tabs)
Q10. Write down the output of the following statements: [Model Paper (Old Curriculum 2009)] (03)
(a) A = (x > 0) && (y < 10) where x = 5, y = 15
(b) S = 13 + 21 % 4
(c) m *= 2; where m = 12
Answer:
-
(a) A = (5 > 0) && (15 < 10) = true && false = 0 (false)
-
(b) S = 13 + 21 % 4 = 13 + 1 = 14 (% has higher precedence)
-
(c) m *= 2 means m = m Γ 2 = 12 Γ 2 = 24
Q11. Write down the purpose and syntax of break statement. [Model Paper (Old Curriculum 2009)] (1.5+1.5)
Answer:
-
Purpose: break terminates (exits) the loop or switch statement immediately, and control passes to the statement after the loop/switch.
-
Syntax:
break;
-
Example:
for (int i = 1; i <= 10; i++) {
if (i == 5) break; // loop stops when i is 5
cout << i << ” “; // output: 1 2 3 4
}
Q12. Write down the purpose and syntax of exit() function. [Model Paper (Old Curriculum 2009)] (1.5+1.5)
Answer:
-
Purpose: exit() terminates the whole program immediately and returns control to the operating system. It is defined in <cstdlib> (stdlib.h).
-
Syntax:
exit(status); // exit(0) = normal termination, exit(1) = error
-
Example:
if (marks < 0) { cout << “Invalid”; exit(1); }
Q13. Why is it important to write comments in a program? Also differentiate its two types. [Model Paper (Old Curriculum 2009)] (1+2)
Answer:
-
Importance: comments explain the purpose and logic of the code, making the program easy to read, understand, debug and maintain by the programmer or others. The compiler ignores them.
-
Types:
-
Single-line comment: starts with //, e.g. // calculate area
-
Multi-line (block) comment: enclosed between /* and */ and can extend over several lines, e.g. /* This program finds the sum of two numbers */
Q14. What is the difference between constant and variable? Give examples also. [Model Paper (Old Curriculum 2009)] (1+2)
Answer:
| Constant | Variable |
|---|---|
| Value cannot be changed during program execution | Value can be changed during execution |
| Declared with const keyword or #define | Declared with a data type |
| e.g. const float PI = 3.14; | e.g. int age = 16; age = 17; |
Q15. Write down the output of the following program segment: [Model Paper (Old Curriculum 2009)] (03)
char c = ‘A’;
do
{
cout << c << “t”;
c = c + 2;
}
while (c <= ‘K’);
Answer:
-
c starts at ‘A’ and increases by 2 each time while c β€ ‘K’: A, C, E, G, I, K.
-
Output: A C E G I K
Q16. Write down the output of the following program segment: [Model Paper (Old Curriculum 2009)] (03)
int values[] = {4, 17, 20, 9, 23};
cout << values[2] << “n”;
cout << ++values[0] << “n”;
cout << values[1]++ << “n”;
Answer:
-
values[2] = 20
-
++values[0]: pre-increment 4 β 5, prints 5
-
values[1]++: post-increment prints 17, then it becomes 18
-
Output (each on new line):
20
5
17
Q17. Rewrite the following statement using if-else statement: [Model Paper (Old Curriculum 2009)] (03)
cout << (((num % 2) == 0) ? “Even n” : “Odd n”);
Answer:
if ((num % 2) == 0)
cout << “Even n”;
else
cout << “Odd n”;
Q18. Convert the following while loop to a for loop such that the output remains same. [Model Paper (Old Curriculum 2009)] (03)
int i = 20;
while (i > 0)
{
cout << i << “t”;
i = i – 2;
}
Answer:
for (int i = 20; i > 0; i = i – 2)
{
cout << i << “t”;
}
-
Output in both cases: 20 18 16 14 12 10 8 6 4 2
Q19. What is the difference between array size and index? Illustrate with example. [Model Paper (Old Curriculum 2009)] (1+2)
Answer:
-
Array size is the total number of elements an array can hold, fixed at declaration. Index is the position number of an element, starting from 0 to size β 1.
-
Example:
int marks[5] = {70, 80, 65, 90, 85};
-
Size = 5 (elements). Index ranges from 0 to 4; marks[0] = 70 and marks[4] = 85. marks[5] is out of range.
Q20. Differentiate between string and array with one example of each. [Model Paper (Old Curriculum 2009)] (1+2)
Answer:
| String | Array |
|---|---|
| Sequence of characters, terminated by a null character ‘ |
