Answers On/OffJS required
Group A
- Q1.Which one of the followings given statement correct?A) Select" from enp where eopid - 103;B) Select from enp where eopid - 103;C) Select eopid where enp - 103 from emp;D) Select eopid where eopid 103 and table - emp;A.A) Select" from enp where eopid - 103;
- Q2.Which database system normally offers better performance for geographically dispersed users ?A) Centralized database systemB) Distributed database systemC) NoSQL database systemD) Relational database systemA.B) Distributed database system
- Q3.Which of the following is an example of a public IPV4 address?A) 192.168.1.1B) 172.16.10.1C) 10.10.10.10D) 203,0.113.10A.D) 203,0.113.10
- Q4.What is the correct syntax for a 'for-loop' in JavaScript?A) for (var i=0;i<5; i++) {}B) for (i=0; i<5; i++) {}C) for (var i=0;i<5) {}D) for (var i<5; i++) ()A.A) for (var i=0;i<5; i++) {}
- Q5.Which PHP function is commonly used to execute SQL queries on a database connection established using mysqli extension?A) mysqli_query()B) pdo_query()C) mysql_query()D) pgsql_query()A.A) mysqli_query()
- Q6.What is the correct syntax to declare a structure in C?A) struct { }C) struct[]B) define struct ()D) struct <name>()A.A) struct { }
- Q7.In C, which operator is used to get the address of a variable?A)"B) &C)->D).A.B) &
- Q8.Which OOP feature allows a class to inherit properties and behavior from another class?A) InheritanceB) EncapsulationC) PolymorphismD) AbstractionA.A) Inheritance
- Q9.Which model of SDLC is characterized by a linear progression of phases from requirements gathering to maintenance?A) Waterfall modelB) Agile modelC) Spiral modelD) RAD modelA.A) Waterfall model
Group B
- Q10.Evaluate the advantages of DBMS compared to traditional file-based data storage systems.A.Answer: DBMS offers several advantages over traditional file-based systems. It ensures data consistency and integrity through constraints and rules. It provides data security by allowing access control and user authentication. DBMS reduces data redundancy by centralizing data storage, which saves space and effort. It allows concurrent data access without conflicts and supports easy data backup and recovery, making it more reliable and efficient for handling large-scale data operations compared to scattered file-based storage.
- Q.OR How does Second Normal Form (2NF) differ from First Normal Form (INF), and what are the key benefits of achieving 2NF in database design? ExplainA.Answer: First Normal Form (1NF) eliminates duplicate columns and ensures that each field contains atomic (indivisible) values. Second Normal Form (2NF) builds on 1NF by removing partial dependencies, which means non-key attributes must depend on the whole primary key, not just part of it.Achieving 2NF improves data integrity, reduces data redundancy, and simplifies data maintenance. It also ensures better logical structure of tables and improves query performance by separating related data into different tables.
- Q11.Write a JavaScript function that checks if a number is even or odd and print the result.A.function checkEvenOdd(num) {if (num % 2 === 0) {console.log(num + " is even");} else {console.log(num + " is odd");}}checkEvenOdd(7); // Output: 7 is odd
- Q.OR What is purpose of the mysqli_connect() function in PHP? Describe its usage and parameters.A.Answer:The mysqli_connect() function is used to establish a connection between PHP and a MySQL database. It enables database interactions like querying and data manipulation.Usage:$conn = mysqli_connect("localhost", "username", "password", "database_name");Parameters:
- localhost – the server host name.
- username – database username.
- password – database password.
- database_name – the database you want to connect to.
- Q12.Write short note on class and object in OOPs with a real-word example.A.Answer: A class in OOP is a blueprint or template for creating objects. It defines attributes and methods common to all objects of that type. An object is an instance of a class that holds real values for the attributes and can use the class’s methods.Example: Consider a class Car with properties like color, brand, and method drive(). An object like car1 = new Car("red", "Toyota") is a real car with red color and Toyota brand that can perform actions like driving.
- Q13.How do various requirement gathering techniques help in achieving a careful grasp of user needs and system requirements during SDLC's analysis phase?A.Answer: Requirement gathering techniques like interviews, questionnaires, observation, document analysis, and joint application development help collect accurate and complete information from users and stakeholders. These techniques ensure that both functional and non-functional requirements are clearly understood. This careful analysis prevents future changes, saves cost, reduces development time, and results in a system that meets the user's expectations.
- Q14.Give five examples of AI applications in the education.A.Answer:
- Intelligent Tutoring Systems – provide personalized learning based on student performance.
- Automated Grading Systems – evaluate objective tests and assignments instantly.
- Chatbots – assist students with FAQs and support services.
- Predictive Analytics – help identify at-risk students and suggest interventions.
- Language Translation Tools – help students overcome language barriers in learning.
Practice Without Boundaries.
Premium gives you full access, zero ads, and unlimited custom paper generation. Study your way, every day.
Group C
- Q15.How does the star network topology differ from the bus network topology in terms of its architectural layout and data transmission methodology in modem computing environments?A.Answer:In modern computing environments, network topologies determine how devices are connected and how data flows between them. Two commonly discussed topologies are star topology and bus topology, which differ significantly in architectural layout and data transmission methods.In a star topology, all devices (nodes) are individually connected to a central device, usually a switch or hub. This central device acts as a controller to manage and forward data to the appropriate recipient. If one cable fails in a star topology, only that specific device is affected, and the rest of the network continues to function normally. This makes it more reliable and easier to maintain or troubleshoot. Data sent from one device goes to the central hub, which then forwards it to the target device based on addressing.In contrast, a bus topology uses a single central cable, called the backbone, to which all devices are connected. Data is transmitted in both directions along the bus, and each device checks if the data is intended for it. If yes, it accepts it; otherwise, it ignores the message. However, only one device can transmit at a time, or data collisions may occur. This makes the bus topology less efficient as traffic increases. Moreover, if the main cable fails, the entire network goes down, making it less reliable and harder to manage.In terms of performance, star topology offers better scalability, security, and speed, as it reduces data collision by managing data through the switch. Bus topology is simpler and cheaper to implement, but it is outdated for modern large-scale systems due to its limited bandwidth and high chances of data collision.To conclude, star topology is more suitable for modern computing environments due to its organized structure, fault tolerance, and efficient data management, while bus topology is mainly found in older or smaller networks where cost-saving was a priority over performance.
- Q16.Write a C program that uses structures to represent details of five books (title, author, publisher and price) and prints them out.A.#include <stdio.h>struct Book {char title[50];char author[50];char publisher[50];float price;};int main() {struct Book books[5];int i;// Input details for 5 booksprintf("Enter details of 5 books: ");for(i = 0; i < 5; i++) {printf("\nBook %d: ", i + 1);printf("Title: ");scanf(" %[^ ]", books[i].title); // Reads string with spacesprintf("Author: ");scanf(" %[^ ]", books[i].author);printf("Publisher: ");scanf(" %[^ ]", books[i].publisher);printf("Price: ");scanf("%f", &books[i].price);}// Display the book detailsprintf("\nDetails of the books: ");for(i = 0; i < 5; i++) {printf("\nBook %d: ", i + 1);printf("Title: %s ", books[i].title);printf("Author: %s ", books[i].author);printf("Publisher: %s ", books[i].publisher);printf("Price: $%.2f ", books[i].price);}return 0;}
- Q16.(OR) Discuss the concept of binary file handling in C programming and explain how putw() and getw() functions facilitate binary input/output operations. Give examples.A.Answer:Binary file handling in C refers to reading from and writing to files in binary format rather than text format. Unlike text files where data is stored as readable characters (ASCII), binary files store data in the same format as in memory (raw bytes), making them more efficient and faster for large or structured data like arrays, structures, etc.C provides specific functions for binary file handling, and two such functions are putw() and getw() which are used for writing and reading integer data to and from binary files.putw() Function:
- Used to write an integer to a file in binary form.
- Syntax: putw(int value, FILE *fp);
- It writes the binary representation of the integer value to the given file.
getw() Function:- Used to read an integer from a binary file.
- Syntax: int getw(FILE *fp);
- It reads the binary representation of the integer from the file and returns it.
Example Code:#include <stdio.h>int main() {FILE *fp;int num, i;// Writing integers to a binary filefp = fopen("data.bin", "wb"); // Open in binary write modeif(fp == NULL) {printf("Error opening file. ");return 1;}for(i = 1; i <= 5; i++) {putw(i * 10, fp); // Writing integers 10, 20, ..., 50}fclose(fp);// Reading integers back from the binary filefp = fopen("data.bin", "rb"); // Open in binary read modeif(fp == NULL) {printf("Error opening file. ");return 1;}printf("Reading data from binary file: ");while((num = getw(fp)) != EOF) {printf("%d ", num);}fclose(fp);return 0;}Explanation:- The program first writes five integers (10 to 50) to a binary file using putw().
- Then it reopens the file in binary read mode and reads those integers using getw().
- The binary format ensures that the data is compact and not affected by formatting or extra characters (like newline or tab).
Conclusion:Binary file handling is crucial when performance and data integrity are important. putw() and getw() offer a simple way to perform binary input/output operations with integers, though for structures and more complex data, fwrite() and fread() are more commonly used.