PBA X COMPUTER SCIENCE PAPER WITH SOLUION
PBA COMPUTER SCIENCE (SSC-II)
|
Total Marks: 30 |
Time Allowed: 2 Hours |
|
Class: X / SSC-II |
Subject: Computer Science |
Note: Attempt all questions and write answers clearly within the spaces or
sheets provided.
SECTION-A
[3 x 6 = 18 Marks]
Q-1: JavaScript
Programming [6 Marks]
a. Debug and correct the following JavaScript code so that
it displays the largest mark in the list. (HINT: the code may contain syntax as
well as logical errors) (3 Marks)
let marks
= [45, 90, 67, 78
let largest = marks[0];
for (let i = 1; i <= marks.length; i++)
{
if (marks[i] < largest)
{
largest = marks[i];
}
}
document.write("Largest: " + Largest);
b. Write a JavaScript program that uses a for loop to print
the multiplication table of 7 from 7 x 1 to 7 x 10. (3 Marks)
Q-2: HTML Web Design [6 Marks]
Design a Student Registration webpage using HTML. The
webpage should include the following elements:
·
a. Set a Title for the webpage and a main
heading "Student Registration" using the correct heading tag. (1
Mark)
·
b. Include an HTML unordered list of any three
hobbies, followed by a hyperlink with the text "Visit FBISE" that
opens https://www.fbise.edu.pk. (2 Marks)
·
c. Add a registration form containing: a text field
for Name, an email field for Email, a drop-down list for Class (options: 9 and
10), and a Submit button. (3 Marks)
Q-3: Integrated Web Technologies (HTML/CSS/JS) [6 Marks]
Consider the following HTML code:
<div
class="card">
<h2 id="title">Welcome</h2>
<p>Learn Computer
Science</p>
<button
id="btn">Click Me</button>
</div>
a. Write CSS code to achieve the following design layouts:
(1 x 4 = 4 Marks)
·
(1) Set the width of the card to 300px and
centre it horizontally on the page.
·
(2) Give the card a 2px solid dark blue border
and a light-yellow background colour.
·
(3) Make the heading text red and
centre-aligned.
·
(4) Change the button background colour to green
when the mouse hovers over it.
b. Write a JavaScript function changeTitle() that changes
the text of the heading (id = "title") to "Hello Student".
Then, show how the HTML button element can be modified to call this function
when clicked. (2 Marks)
SECTION-B [3 x 4 = 12 Marks]
Q-4: Computer
Networking & Architecture [4 Marks]
a. Identify the type and write the purpose of each of the
following networking hardware items: (2 Marks)
|
Item Diagram Reference |
Hardware Name |
Primary Purpose / Role |
|
Item 1: Multi-port Box Device |
[ Blank space for Student Answer ] |
[ Blank space for Student Answer ] |
|
Item 2: Guided Coaxial Cable / Connector |
[ Blank space for Student Answer ] |
[ Blank space for Student Answer ] |
b. Design an Input-Process-Output (IPO) chart that takes three numbers as input
and displays whether each number is even or odd. (2 Marks)
Q-5: Algorithm Design & Problem Solving [4 Marks]
a. Decompose the high-level computational problem
"Organizing a School Sports Day" into any three distinct, manageable
sub-problems. (1 Mark)
b. Explain or draw the algorithmic structure (flowchart
components) required to search for a target number within a list of five
numbers using Linear Search, displaying "Found" or "Not
Found". (3 Marks)
Q-6: Entrepreneurship & Business Planning [4 Marks]
Ayesha notices that students in her school have no healthy
snack option at break time. She decides to start a small home-based business
selling healthy fruit cups. One batch makes 20 fruit cups, and the production
costs of one single batch are broken down below:
• Fruits: 600 Rs
• Yogurt and Honey: 250 Rs
• Cups and Spoons: 150 Rs
• Gas and Water utilities: 100 Rs
Complete her business plan structure by filling in the
fields below:
a. BUSINESS NAME: _________________________
b. BUSINESS IDEA (Problem it solves): _________________________
c. COST OF PRODUCTION:
(1) Total cost of one batch = Rs
_________________
(2) Cost of one individual fruit cup =
Rs _________________ (Show numerical working below)
d. OBJECTIVE AND POTENTIAL TARGET CUSTOMERS: _________________________
EXAMINATION SOLUTION MANUAL & ANSWER KEY
SOLUTION FOR Q-1:
JavaScript Diagnostics
a. Identified Errors
& Corrected Code:
·
1. Syntax Error: Missing closing square bracket
']' on the array assignment line.
2. Logical Error: The loop boundary condition 'i <= marks.length' results in
an Out-of-Bounds error. It must be 'i < marks.length'.
3. Logical Error: The condition 'if (marks[i] < largest)' incorrectly
searches for the minimum score instead of the maximum. It must be '>'.
4. Syntax Error: Case sensitivity mismatch on the display method call. 'Largest'
must be written in lowercase 'largest'.
//
Corrected Code Snippet
let marks = [45, 90, 67, 78];
let largest = marks[0];
for (let i = 1; i < marks.length; i++) {
if (marks[i] > largest) {
largest = marks[i];
}
}
document.write("Largest: " + largest);
b. Multiplication
Table of 7 Program:
for (let
i = 1; i <= 10; i++) {
let result = 7 * i;
document.write("7 x " + i +
" = " + result + "<br>");
}
SOLUTION FOR Q-2: Full HTML Document
<!DOCTYPE
html>
<html>
<head>
<title>Student Registration
System</title>
</head>
<body>
<h1>Student
Registration</h1>
<h3>Hobbies List:</h3>
<ul>
<li>Reading
Books</li>
<li>Coding
Projects</li>
<li>Playing
Sports</li>
</ul>
<p><a
href="https://www.fbise.edu.pk" target="_blank">Visit
FBISE</a></p>
<form>
<label>Name:</label>
<input type="text" name="studentName"
required><br><br>
<label>Email:</label>
<input type="email" name="studentEmail"
required><br><br>
<label>Class:</label>
<select
name="studentClass">
<option
value="9">Grade 9</option>
<option
value="10">Grade 10</option>
</select><br><br>
<input type="submit"
value="Submit Registration">
</form>
</body>
</html>
SOLUTION FOR Q-3: Web Layout Style & Logic
a. Required CSS
Rules:
/* (1)
Card Width and Horizontal Centering */
.card {
width: 300px;
margin: 0 auto;
/* (2) Border & Background
styling */
border: 2px solid #003366;
background-color: #FFFFE0;
}
/* (3) Heading Realignment */
#title {
color: red;
text-align: center;
}
/* (4) Button Hover State Pseudo-Class */
#btn:hover {
background-color: green;
}
b. JavaScript DOM
Modification Function:
//
Script Definition
function changeTitle() {
document.getElementById("title").innerHTML
= "Hello Student";
}
// Modified HTML Button Element Execution Trigger:
<button id="btn" onclick="changeTitle()">Click
Me</button>
SOLUTION FOR Q-4: Networking Architecture & Charting
a. Hardware Profiles:
·
• Item 1: Network Switch / Hub. Purpose:
Connects multiple devices together on a local area network (LAN) and
intelligently forwards traffic packets based on MAC targets.
·
• Item 2: Coaxial Guided Medium Cable / BNC
Connector. Purpose: High-frequency data transmission media widely utilized for
cable television networks and baseline legacy computer network installations.
b. IPO Chart
Structural Layout:
|
INPUTS |
PROCESSING LOOPS |
OUTPUT RESISTANCE |
|
Three numerical inputs: |
For each input element variable N: |
Display status properties directly onto screen: |
SOLUTION FOR Q-5: Computational Logic & Flowcharts
a. Decomposition
Vectors:
·
1. Logistics & Vendor Booking: Managing
track lanes, equipment acquisition, and award systems.
·
2. Schedule & Participant Mapping:
Scheduling race fixtures, group designations, and team parameters.
·
3. Safety, Medical, & Catering Protocols:
Setting up critical health response booths and resource allocations.
b. Linear Search
Flowchart Sequence Map:
·
1. [START] Block -> Read target element key
item X and input array list of size 5.
·
2. [INITIALIZE] Establish a pointer index
integer variable i = 0.
·
3. [DECISION DIAMOND] Is index pointer i < 5?
If No, route immediately to Step 6.
·
4. [DECISION DIAMOND] Does current index
position value Match target X (List[i] == X)? If Yes, print 'Found' and
transition to [END].
·
5. [PROCESS BOX] Increment loop index pointer i
by 1 (i = i + 1). Return to Step 3 tracking loop.
·
6. [OUTPUT TERMINAL] Print 'Not Found' display
prompt and exit cleanly to [END].
SOLUTION FOR Q-6: Strategic Case-Study Business Plan
a. BUSINESS NAME:
Fresh Start Fruits / Ayesha's Elite Healthy Crunch (Any creative local option
is valid)
b. BUSINESS IDEA:
Resolves the complete absence of nutritious, clean, and organic snacks
available to young students during standard school recess hours.
c. COST OF PRODUCTION
CALCULATION (Show Working):
(1) Total Cost of One Batch calculation:
= Fruits (600) + Yogurt & Honey
(250) + Cups & Spoons (150) + Gas & Water (100)
= 1,100 Rs total per batch.
(2) Individual Unit Cost calculation:
= Total Batch Cost / Total Units Yielded
= 1,100 Rs / 20 Cups
= 55 Rs per individual fruit cup
container cost.
d. OBJECTIVE AND
TARGET CUSTOMERS: To sell fresh snack variations to primary and secondary
school children, teachers, and administrative school staff during active break
sessions.

Comments