FBISE, NCP & NBF-aligned resources for Classes 9–12
Browse by Class
Browse by Type
Computer Chapter 3 : Test # 5
1 / 20
A beginner creates a variable named 7marks and discovers that the program does not accept it. The issue is related to JavaScript naming rules rather than program logic. Which rule has been violated?
Reasoning: Variable names cannot begin with a number.
2 / 20
A programmer creates two variables named reward and Reward and expects them to store the same value. However, the program treats them separately and produces unexpected results. Why does this happen?
Reasoning: JavaScript is case-sensitive, so the names are different variables.
3 / 20
A school reward system needs to determine how many points remain after dividing a student's score by 10. The programmer is interested only in the leftover amount rather than the quotient. Which operator should be used?
Reasoning: The modulus operator % returns the remainder after division.
4 / 20
A program runs without displaying any syntax warnings or runtime crashes, yet it calculates incorrect examination results because the formula used by the programmer is wrong. What type of error is this?
Reasoning: Logical errors occur when code executes but produces incorrect results.
5 / 20
A developer places markers at specific lines in a program so that execution pauses automatically during debugging. This allows variables and program flow to be inspected carefully before continuing. What are these markers called?
Reasoning: Breakpoints pause program execution for debugging and analysis.
6 / 20
A school is redesigning its website and wants a welcome video to start automatically whenever visitors open the homepage. The video should continue playing repeatedly without requiring any user interaction and should not produce sound that may disturb users. Which HTML attribute ensures automatic playback?
Reasoning: The autoplay attribute starts the video automatically when the webpage loads.
7 / 20
A web developer embeds a promotional video on a webpage. To prevent browsers from blocking automatic playback and to avoid disturbing users, the video should start silently when the page opens. Which attribute should be included?
Reasoning: The muted attribute allows videos to autoplay without sound.
8 / 20
A student wants an educational video on a webpage to play continuously during a presentation. After reaching the end, the video should immediately restart without requiring the audience to click any button. Which attribute provides this functionality?
Reasoning: The loop attribute makes a video replay continuously.
9 / 20
Before uploading a large video file to a website, a developer compresses it while maintaining acceptable quality. The goal is to reduce loading time and improve visitor experience. Why is this optimization step important?
Reasoning: Optimized videos load faster and improve website performance.
10 / 20
A school wants to publish examination results online in a structured format where students can easily compare names, roll numbers, and marks across multiple subjects. Which HTML element serves as the main structure for organizing this information?
Reasoning: The
11 / 20
While creating a webpage showing examination results, a developer wants the first row to display headings such as Name, Roll Number, and Marks. Which HTML tag should be used for these heading cells?
Reasoning:
12 / 20
A programmer creates a webpage that initially displays numbers in ascending order. When a button is pressed, the numbers are displayed in descending order instead. What JavaScript concept allows this behavior to occur in response to the button press?
Reasoning: JavaScript events allow code to respond to user actions like button clicks.
13 / 20
A webpage contains a button labeled “Descending Order.” When clicked, a JavaScript function executes and changes the displayed output. What is the primary purpose of the function in this situation?
Reasoning: Functions are reusable blocks of code designed to perform specific tasks.
14 / 20
A developer wants a webpage background to change color whenever a user clicks a button. The color change should happen instantly without reloading the page. Which technology is mainly responsible for modifying the webpage dynamically?
Reasoning: JavaScript can dynamically modify webpage properties such as background color.
15 / 20
A school website displays student records based on roll numbers entered by users. Instead of creating a separate webpage for every student, the content changes automatically according to user input. What type of website is this?
Reasoning: Dynamic websites change content based on user input or other conditions.
16 / 20
A developer notices that maintaining hundreds of separate webpages for student results is becoming difficult. To solve this issue, the website is redesigned so that a single page generates results according to user requests. What is the main advantage of this approach?
Reasoning: Dynamic websites reduce the need to manage many separate pages.
17 / 20
A webpage contains a section whose content changes whenever a visitor presses a button or enters information into a form. This portion of the page updates according to user interaction. What is this type of content called?
Reasoning: Dynamic content changes in response to user actions.
18 / 20
A school website retrieves student information from a database and displays personalized results for each visitor. Which feature of dynamic websites makes this possible?
Reasoning: Dynamic websites generate content based on user requests and data.
19 / 20
A web developer tests a page containing a video, a dynamic table, and interactive buttons on different browsers and mobile devices. Why is this testing step necessary before publishing the website?
Reasoning: Testing ensures that website features work correctly across devices and browsers.
20 / 20
A programmer wants a webpage to update only a specific portion of content when a user interacts with it, instead of creating a completely new page. Which characteristic of dynamic websites supports this behavior?
Reasoning: Dynamic websites can update selected content areas without recreating entire webpages.
Your score is
Restart quiz