CS521 – Data Science Principles: Midterm Important MCQs (39 Solved Questions)
Computer Science • Read every solved MCQ with its verified answer key directly on this page. Free, no login required.
All 664 Midterm Packs · CS521 Course Page · CS521 Subjective Pack (30 Q&As)
-
In the CSS code given in the paper for the Virtual University of Pakistan, the selector `.vu-pakistan` is which type of selector?
Topic: CSS Basics & Styling Code
- Class selector ✓ Correct answer
- ID selector
- Element selector
- Universal selector
-
In the paper's CSS code, which property is used to set the background color of the element?
Topic: CSS Basics & Styling Code
- color
- background-color ✓ Correct answer
- bgcolor
- border-color
-
In the given code, the declaration `color: #ffffff;` controls which of the following?
Topic: CSS Basics & Styling Code
- The background color
- The border color
- The text (foreground) color ✓ Correct answer
- The shadow color
-
The value `#007bff` used in the paper's CSS code is an example of:
Topic: CSS Basics & Styling Code
- A color name
- An RGB function
- A hexadecimal (hex) color value ✓ Correct answer
- An HSL value
-
In the code `.vu-pakistan { ... padding: 20px; ... }`, the padding declaration gives the element:
Topic: CSS Basics & Styling Code
- 20px space outside the border
- 20px space inside the element, around the content ✓ Correct answer
- A 20px thick border
- A 20px font size
-
In the declaration `border: 1px solid #0069d9;` given in the paper, `1px` specifies the border's:
Topic: CSS Basics & Styling Code
- Style
- Color
- Width ✓ Correct answer
- Radius
-
According to the paper, which layer of the application stack is responsible for the User Interface?
Topic: Application Stack & Its Layers
- Application Layer
- Data Access Layer
- Presentation Layer ✓ Correct answer
- Infrastructure Layer
-
According to the paper, the Business Logic of an application is handled by the:
Topic: Application Stack & Its Layers
- Business Layer
- Application Layer ✓ Correct answer
- Presentation Layer
- Infrastructure Layer
-
In the paper's application stack, Data Processing is the responsibility of the:
Topic: Application Stack & Its Layers
- Data Access Layer
- Presentation Layer
- Business Layer ✓ Correct answer
- Application Layer
-
Which layer of the application stack performs Database Interaction?
Topic: Application Stack & Its Layers
- Infrastructure Layer
- Business Layer
- Data Access Layer ✓ Correct answer
- Presentation Layer
-
Networking and Storage in the application stack are handled by the:
Topic: Application Stack & Its Layers
- Data Access Layer
- Infrastructure Layer ✓ Correct answer
- Application Layer
- Business Layer
-
How many layers are listed in the paper's components of the application stack?
Topic: Application Stack & Its Layers
- Three
- Four
- Five ✓ Correct answer
- Six
-
According to the paper, a static server serves:
Topic: Static vs Dynamic Servers
- Dynamically generated pages
- Pre-built HTML files ✓ Correct answer
- Database records
- Server-side scripts
-
A dynamic server differs from a static server because it:
Topic: Static vs Dynamic Servers
- Serves only images
- Generates HTML content dynamically ✓ Correct answer
- Cannot use HTML
- Works without a browser
-
Which type of server supports server-side scripting such as PHP and Python?
Topic: Static vs Dynamic Servers
- Static server
- Dynamic server ✓ Correct answer
- File server
- Mail server
-
As described in the paper, a static server is:
Topic: Static vs Dynamic Servers
- Slow and complex
- Fast and efficient, but with limited functionality ✓ Correct answer
- More flexible and interactive
- Dependent on server-side scripting
-
Which server type is described in the paper as more flexible and interactive?
Topic: Static vs Dynamic Servers
- Static server
- Dynamic server ✓ Correct answer
- Proxy server
- Backup server
-
Which of the following is the JavaScript array declaration used in the paper?
Topic: JavaScript Arrays
- let array = (1, 2, 3, 4, 5);
- let array = {1, 2, 3, 4, 5};
- let array = [1, 2, 3, 4, 5]; ✓ Correct answer
- array int = [1, 2, 3, 4, 5];
-
For the declaration `let array = [1, 2, 3, 4, 5];`, the value of `array.length` is:
Topic: JavaScript Arrays
- 4
- 5 ✓ Correct answer
- 6
- 0
-
In JavaScript, the first element of an array is accessed at index:
Topic: JavaScript Arrays
- 1
- -1
- 0 ✓ Correct answer
- length
-
In the paper's students/marks program (`students = ["Ali", "Sara", "Ahmed", "Zain", "Aisha"]`), the value of `students[0]` is:
Topic: JavaScript Arrays
- Sara
- Aisha
- Ahmed
- Ali ✓ Correct answer
-
In the same program (`marks = [85, 90, 78, 88, 95]`), the value of `marks[4]` is:
Topic: JavaScript Arrays
- 85
- 88
- 95 ✓ Correct answer
- 78
-
In the paper's program, the loop `for (let i = 0; i < students.length; i++)` runs how many times for the 5 students?
Topic: JavaScript Arrays
- 4 times
- 5 times ✓ Correct answer
- 6 times
- 10 times
-
What is the output of the paper's `sumArray([1, 2, 3, 4, 5])` function?
Topic: JavaScript Functions & Basic Programs
- 10
- 14
- 15 ✓ Correct answer
- 25
-
In the `sumArray` function given in the paper, the variable `sum` is initialized to:
Topic: JavaScript Functions & Basic Programs
- 1
- 0 ✓ Correct answer
- array[0]
- array.length
-
Which keyword is used inside a JavaScript function to send the result back to the caller?
Topic: JavaScript Functions & Basic Programs
- output
- return ✓ Correct answer
- break
-
In the paper's program with `num1 = 5` and `num2 = 10`, the output printed is:
Topic: JavaScript Functions & Basic Programs
- The sum is: 10
- The sum is: 15 ✓ Correct answer
- 15 is the sum of 5
- The sum is: 50
-
In the JavaScript programs given in the paper, `console.log()` is used to:
Topic: JavaScript Functions & Basic Programs
- Declare a variable
- Define a function
- Print output to the console ✓ Correct answer
- Create an array
-
According to the paper, the CSS Box Model consists of how many main parts?
Topic: CSS Box Model
- Two
- Three
- Four ✓ Correct answer
- Five
-
In the CSS Box Model, the part where the actual text and images of an element appear is the:
Topic: CSS Box Model
- Margin
- Content ✓ Correct answer
- Border
- Padding
-
In the CSS Box Model, Padding is the space between:
Topic: CSS Box Model
- Two different elements
- The border and other elements
- The content and the border ✓ Correct answer
- The margin and the border
-
In the CSS Box Model, Margin is the space between:
Topic: CSS Box Model
- The content and the padding
- The border and the other (surrounding) elements ✓ Correct answer
- The padding and the border
- The text and the images
-
What is the correct order of the CSS Box Model parts from the inside to the outside?
Topic: CSS Box Model
- Margin → Border → Padding → Content
- Content → Padding → Border → Margin ✓ Correct answer
- Content → Border → Padding → Margin
- Padding → Content → Margin → Border
-
According to the paper, `p {}` is an example of which selector?
Topic: CSS Selectors & Pseudo-Classes
- Class selector
- ID selector
- Element selector ✓ Correct answer
- Pseudo-class
-
Which CSS selector is used to style elements having a specific class?
Topic: CSS Selectors & Pseudo-Classes
- #class {}
- .class {} ✓ Correct answer
- :class {}
- *class {}
-
According to the paper, the `#id {}` selector is used to style:
Topic: CSS Selectors & Pseudo-Classes
- All elements of a page
- Elements of one class
- A single unique element ✓ Correct answer
- Only paragraph elements
-
The `:hover` pseudo-class applies a style when:
Topic: CSS Selectors & Pseudo-Classes
- The page is loaded
- The user moves the mouse over the element ✓ Correct answer
- The element is clicked once
- The browser window is resized
-
The `:first-child` pseudo-class selects:
Topic: CSS Selectors & Pseudo-Classes
- The first element of the whole page
- The first child element of a parent ✓ Correct answer
- The last child element of a parent
- All child elements of a parent
-
Selectors written with a colon, such as `:hover` and `:first-child`, are called:
Topic: CSS Selectors & Pseudo-Classes
- Element selectors
- Pseudo-classes ✓ Correct answer
- Class selectors
- ID selectors