12model Question
12model Question
2079(2023)
Computer Science
Full Marks: - 50
Group A
Rewrite the correct options of each question
in your answer sheet. (9x1=9)
A) First
B) Second
C) Third
D) Fourth
2. Which of the following techniques is not
implemented to protect a database?
A) Rollback
B) Backup
C) Recovery
D) Firewall
A) 192.168.0.1
B) 192.168.1
C) 172.255.0.0
D) 202.10.79.4
A) JavaScript
B) MySql
C) PHP
D) Jquery
A) int or var
B) float or let
C) var or let
D) char or var
7. Which of the following commands is executed in
PHP to concatenate the variables $x with $y??
A) $x + $y
B) $x=$y
C) concat ($x,$y)
D) $x.$y
Correct Answer is Option D (Que no 7)
A) Technical feasibility
B) Economic feasibility
C) Operational feasibility
D) Schedule feasibility
Group B
OR
<html>
<head>
</head>
<body>
<script>
let a = 5;
let b = 10;
let temp = a;
a = b;
b = temp;
</script>
</body>
</html>
OR
Solution:
To connect MySQL database with PHP, you can use
the following steps:
(1)Create a new PHP file and write the following
code to establish a connection with MySQL:
<?php
$servername = "localhost";
$username = "your_username";
$password = "your_password";
$dbname = "your_database_name";
$conn = mysqli_connect($servername, $username,
$password, $dbname);
if (!$conn) {
?>
Solution:
Object oriented programming is a programming
paradigm that was developed to overcome the
drawbacks and limitations of particularly procedure-
oriented programming. The major need for
developing such languages was to manage the
ever-increasing size and complexity of programs.
Procedural programming is a programming
paradigm that organizes software design around
procedures. Procedures are self-contained units of
code that perform a specific task. Procedural
programming is based on the concept of "functions"
that take inputs and produce outputs. Functions are
called by other functions to perform tasks.
The main difference between OOP and procedural
programming is their approach to code
organization. In procedural programming, the
program is divided into small parts called functions.
In OOP, the program is divided into small parts
called objects. Procedural programming follows a
top-down approach while OOP follows a bottom-up
approach.
Disadvantages
Group C
Give the long answers to the following
questions.
Solution:
Client-server architecture is a type of computer
network architecture where many clients (remote
processors) request and receive service from a
centralized server (host computer). Many business
organizations prefer setting their network with the
client-server architecture due to its several
advantages. Here are some advantages and
disadvantages of client-server architecture:
Advantages:
Disadvantages:
Solution:
#include <stdio.h>
struct student {
int roll_number;
char name[50];
int sub1;
int sub2;
int sub3;
};
int main() {
int i;
printf("\nRoll No.\tName\t\tSub1\tSub2\tSub3\
tTotal\tPercentage\n");
for (i = 0; i < 12; i++) {
printf("%d\t\t%s\t\t%d\t%d\t%d\t%d\t%.2f%%\n",
s[i].roll_number, s[i].name, s[i].sub1, s[i].sub2,
s[i].sub3, total, percentage);
return 0;
OR
Solution:
#include <stdio.h>
#include <stdlib.h>
struct student {
int reg_no;
char name[50];
char gender;
char address[100];
};
int main() {
FILE *fp;
struct student s;
char another;
fp = fopen("score.dat", "wb");
if (fp == NULL) {
exit(1);
}
do {
printf("Reg_no: ");
scanf("%d", &s.reg_no);
printf("Name: ");
scanf("%s", s.name);
printf("Address: ");
scanf("%s", s.address);
fclose(fp);
fp = fopen("score.dat", "rb");
if (fp == NULL) {
printf("Error opening file.\n");
exit(1);
fclose(fp);
return 0;