NEB Question model of class 12 computer
Introduction:
Structure of the NEB Question Model of Class 12 Computer:
Solved example of NEB Question model of class 12 computer
Grade: 12 Sub: Computer Science
Time: 2 hrs. Full Marks: 50
Candidates are requested to give their answers in their own words as far as practicable.
The figures in the margin indicate full marks.
Group ‘A’
Re-write the correct options of each question in your answer sheet. (9×1=9)1. Which of the following is used to display the output in PHP?
2. The primary key does not accept …….
(c) Network layer (d) Data link layer
4. A table named product(pid, pname, price) contains records. To fetch all records in SQL we use 5
(a) SELECT * FROM product;
(b) DISPLAY all;
(c) PRINT all from product;
(d) PRINT * from product;
var string1="40";
var intvalue=50;
alert(string1+intvalue);
</script>
a) 40 b) 50 c) 4050 d) 40 50
6. The ____________ determines whether the project should go forward.
(b) opportunity identification
(c) system evaluation
(d) program specification
7. Which of the following is a technology that is commonly used in virtual reality (VR) systems?
(b) Mobile computing
(c) Augmented reality (AR)
(d) Natural language processing (NLP)
8. Which software prevents external access to a system?
9. Which of the following is the way in which an IoT device is associated with data?
Group ‘B’
Give short answer of the following questions. (5×5=25)10. Explain normalization with its advantages. Give an example of 1NF. (3+2)
Advantages of Normalization:
i) Improved data quality
ii) Reduced data redundancy
iii) Better database design
iv) Reduced data anomalies
Example of 1NF:
Let's consider an example to understand 1NF.
Suppose we have a table of employees as follows:
Consider a table named "Customers" with the following attributes:
CustomerID |
Name |
Phone Numbers |
001 |
Ram |
123456789, 987654321 |
002 |
Sita |
555555555, 666666666, 777777777 |
So, we can create a new table named "PhoneNumbers" with the attributes CustomerID and PhoneNumber, and remove the "Phone Numbers" attribute from the "Customers" table. The "Customers" table would now have the following attributes:
CustomerID |
Name |
001 |
Ram |
002 |
sita |
CustomerID |
PhoneNumber |
001 |
123456789 |
001 |
987654321 |
002 |
555555555 |
002 |
666666666 |
002 |
777777777 |
What is DBMS? Explain the benefits and limitations of a centralized database system. (1+4)
Ans: DBMS stands for Database Management System. It is a software system that allows users to create, modify, and manage databases. A DBMS provides a way to store and organize data in a structured and secure manner, making it easier to access and manage data for multiple users and applications.
Common examples of DBMSs include Ms-Access, Oracle, MySQL, Microsoft SQL Server, and PostgreSQL.
- Centralized control of data
- Improved data consistency and accuracy
- Improved security and access control
- Simplified backup and recovery procedures
- Reduced data redundancy and storage requirements
- Reduced costs of managing multiple databases
- Dependency on a single database server
- Limited availability and accessibility
- Increased network traffic and latency
- Reduced data privacy and confidentiality
- High cost of maintenance and upgrades
- Increased risk of data loss or corruption due to system failures.
11. Write a JavaScript program to check whether the given number is odd or even. (5)
Ans:
<html>
<head>
<title>javascript if</title>
<body>
let num = prompt("Enter a number: ");
if (num % 2 === 0) {
alert(num + " is even.");
}
else {
alert(num + " is odd.");
}
</script>
</body>
</html>
(Using Function in JS)
<html>
<head>
<title></title>
<script>
// Define a function to check whether a number is odd or even
function checkOddOrEven(number) {
if (number % 2 === 0) {
return number + " is an even number.";
} else {
return number + " is an odd number.";
}
}
// Prompt the user to input a number and pass it to the checkOddOrEven() function
let inputNumber = parseInt(prompt("Enter a number: "));
let result = checkOddOrEven(inputNumber);
// Display the result in an alert box
alert(result);
</script>
</body>
</html>
Write PHP code to create SQL database with server-side scripting. (5)
<?php
$servername = "localhost";
$username = "root";
$password = "";
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Create database
$sql = "CREATE DATABASE myDB";
if ($conn->query($sql) === TRUE) {
echo "Database created successfully";
} else {
echo "Error creating database: " . $conn->error;
}
$conn->close();
?>
12. What is OOP? List its features and explain any one of them. (1+1+3)
Ans: Object-Oriented Programming (OOP) is a programming paradigm that uses the concept of objects to represent data and the operations that can be performed on that data. It emphasizes modular programming and code reusability by grouping related data and functions into classes, which can then be used to create instances (objects) that inherit the properties and methods of the class.
Following are the features of OOP.
- Encapsulation
- Abstraction
- Inheritance
- Polymorphism
- Class
- Object
Abstraction:
Abstraction in OOP refers to the process of hiding the complexity of an object or system by focusing only on the essential features and ignoring the rest. It allows programmers to create simplified representations of complex real-world problems, making them easier to understand and work with. Abstraction is achieved through the use of abstract classes, interfaces, and methods, which define a set of common behaviors that can be inherited and implemented by subclasses.13. What is a software development model? Explain about prototype model. (1+4)
Ans: A software development model is a structured approach to software development that provides guidelines for building high-quality software within a specific time frame and budget. It outlines the tasks, activities, and milestones required for the successful completion of a software project. Examples of software development models include the waterfall model, agile model, spiral model, and prototype model.
Prototype Model:
The prototype model is a software development model in which a prototype of the software is developed early in the development life cycle. The prototype is used to gather requirements and feedback from stakeholders, which are then used to refine the requirements and design of the final software product. The model is iterative, meaning the prototype is refined through multiple cycles until it meets the requirements and expectations of the stakeholders.
Merits:
- Early feedback from stakeholders can identify issues before they become major problems.
- Iterative nature allows for continuous refinement of the software, leading to a better final product.
- Helps to reduce development time and cost by identifying issues early in the development life cycle.
- Can be difficult to manage changes to the software during the iterative process.
- May require more resources and time for development and testing.
- Not suitable for projects with fixed or rigid requirements.
14. What is e-commerce? Explain its types. (1+4)
Ans: E-commerce, or electronic commerce, refers to the buying and selling of goods or services over the internet. It involves online transactions between businesses, consumers, or both, using electronic devices such as computers, smartphones, or tablets. E-commerce has revolutionized the way people shop and do business, making it more convenient, faster, and accessible to a wider audience.
Following are the different types of e-commerce.
Business-to-Business (B2B): This type of e-commerce involves transactions between two businesses, such as manufacturers selling to wholesalers or suppliers. B2B e-commerce is typically characterized by larger order quantities, longer-term contracts, and more complex supply chain management.
Business-to-Consumer (B2C): B2C e-commerce involves transactions between businesses and individual consumers. This is the most well-known and common type of e-commerce, and it allows consumers to purchase products and services directly from businesses online.
Consumer-to-Consumer (C2C): This type of e-commerce involves transactions between individual consumers, such as online marketplaces where people can buy and sell products to each other. C2C e-commerce is often facilitated by third-party platforms that provide a safe and secure environment for transactions.
Consumer-to-Business (C2B): In C2B e-commerce, individual consumers offer products or services to businesses. This can include freelance work, consulting services, or product reviews. C2B is often used in the gig economy, where individuals offer their skills or services on a project-by-project basis.
Group ‘C’
Give a long answer to the following question. (2×8=16)15. What do you mean by LAN topology? Explain Bus, Star and Ring topology with their merits and demerits. (2+6)
Ans: LAN topology refers to the way in which devices are interconnected in a local area network (LAN). The term "topology" describes the physical or logical arrangement of the devices and the way they communicate with one another.
Following are the different types of topologies.
Bus Topology: In a bus topology, all devices are connected to a single communication line, called a bus. Data is transmitted in both directions along the bus, and all devices receive the same data simultaneously.
Advantages:
- Easy to set up and requires less cabling than other topologies.
- Well suited for small networks.
- Inexpensive compared to other topologies.
Disadvantages:
- Can become slow when many devices are connected to the network.
- If the bus fails, the entire network fails.
- Limited distance coverage, and any issues with the cable can cause the entire network to malfunction.
Advantages:
- Failure of one device does not affect the entire network.
- Easy to add or remove devices without affecting the rest of the network.
- Centralized management makes troubleshooting and maintenance easier.
- Requires more cabling than a bus topology.
- Failure of the central hub or switch will result in the failure of the entire network.
- The cost of the central hub or switch can be higher compared to a bus topology.
Advantages:
- No collisions in the network as only one device can transmit at a time.
- Good for high-performance networks that need to transmit large amounts of data quickly.
- Failure of one device can break the ring and cause the entire network to fail.
- Adding or removing devices from the network can be difficult.
- Troubleshooting issues in a ring topology can be more challenging than in other topologies.
16. Write a C program to store registration number , name and marks of 5 students using structure and display them in descending order on the basis of marks. (8)
Ans:
#include <stdio.h>
#include <string.h>
struct student {
int rno;
char name[50];
int marks;
} s[5];
int main() {
int i, j;
struct student temp;
// Input registration number, name, and marks of 5 students
for (i = 0; i < 5; i++) {
printf("\nEnter registration number, name, and marks of student %d:\n", i+1);
scanf("%d %s %d", &s[i].rno, s[i].name, &s[i].marks);
}
// Sort the students in descending order based on marks
for (i = 0; i < 5; i++) {
for (j = i+1; j < 5; j++) {
if (s[i].marks < s[j].marks) {
temp = s[i];
s[i] = s[j];
s[j] = temp;
}
}
}
// Display the sorted list of students
printf("\n\nRegistration Number\tName\tMarks\n");
for (i = 0; i < 5; i++) {
printf("%d\t\t\t%s\t%d\n", s[i].rno, s[i].name, s[i].marks);
}
return 0;
}
OR
Write a program in C to create a data file “score.txt” which stores Student ID, Name, marks of computer until user press yes. After that display all the records of file “score.txt”. (4+4)
#include <stdio.h>
int main()
FILE *fptr;
int id, marks;
char name[50], choice;
// Open the file for writing and reading in truncate mode
fptr = fopen("score.txt", "w+");
do
// Input student ID, name, and marks
printf("Enter student ID, name, and marks for the computer subject:\n");
scanf("%d %s %d", &id, name, &marks);
// Write the student record to the file
fprintf(fptr, "%d %s %d\n", id, name, marks);
// Ask user to input more records
printf("Do you want to enter more records? (y/n): ");
scanf(" %c", &choice);
} while (choice == 'y' || choice == 'Y');
rewind(fptr);
// Display all records in the file
printf("\nStudent Records:\n\n");
printf("ID\tName\t\tMarks\n");
while (fscanf(fptr, "%d %s %d", &id, name, &marks) == 3) {
printf("%d\t%s\t\t%d\n", id, name, marks);
}
// Close the file
fclose(fptr);
return 0;
}
No comments:
Post a Comment