NEB year 2065 computer science questions
old syllabus:
------------------------------------------------------------------------
Group 'A' (Long Answer Questions)
Attempt any two of the following questions:[2x20 = 40]
1. a) Write an algorithm and a flowchart for a program that checks whether the number entered by user is exactly divisible by 5 but not by 11.[5]
Ans:-
Algorithm:-
1.start
2.Input a number as 'n'
3.Let, rem1=remainder of n/5
4.Let, rem2=remainder of n/11
5. IF rem1=0 and rem2 not equal to 0
5.1 print "it is divisible by 5 and not by 11"
5.2 goto last step
else
5.11 print "it is divisible by 5 and by 11"
5.21 goto last step
6.stop
Flowchart:-
b) Write a program that reads three numbers and display the largest among them. [5]
Ans:-
// program to get greatest number among three numbers
c) What is an operator? Explain different types of operators used in programming[2+3]
Ans:-
operator:-
for example: +,-,= etc
It is of following types.
1)Arithmetic operator: It is used to do arithmetic calculations/operation.
It has following types.
+ -----------> used for addition.example is a+b. It means we are performing addition with the help of operand a and b
- ------------>It is used for subtraction.Example is a-b. It means we are performing subtraction with the help of operand a and b
* -------------------->used for multiplication.example is a*b. It means we are performing multiplication with the help of operand a and b
/---------------->used for division.example is a/b. It means we are performing division with the help of operand a and b
example
int a=5;
if(!(a==5))
{
printf("it is\n");
}
else
{
printf("it is not\n");
}
here ,the value is 5 but we get output "it is not".It is called reversing the output.
d) What is a program to read a four digit number and display it in reverse order? [5]
Ans:-
/*to reverse a number*/
#include <stdio.h>
int main()
{
int num;
int rem;
printf("enter a four digits number\n");
scanf("%d",&num);
while(num!=0)
{
rem=num%10;
printf("%d",rem);
num=num/10;
}
return 0;
}
2.
a) Write a program to add two matrices.
Ans:-
/* to find sum of two 3x3 matrices*/
#include <stdio.h>
int main()
{
int matrix1[3][3],matrix2[3][3];
int i,j;
printf("enter elements of matrix 1\n");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
scanf("%d",&matrix1[i][j]);
}
}
printf("enter elements of matrix 2\n");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
scanf("%d",&matrix2[i][j]);
}
}
printf("sum of two matrices is \n");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
printf(" %d ",matrix1[i][j]+matrix2[i][j]);
}
printf("\n");
}
return 0;
}
b) Write differences between structure and union with syntax.[10]
Ans:-
The differences between struct and union are given below in tabular form.
struct | Union |
1.It stores dis-similar data.Each gets separate space in memory.They do not share memory | 1. It stores dis-similar type of data.Total memory space is equal to the member with largest size.They share memory space. |
2.we can access member in any sequence . | 2.We can access that whose value is recently used. |
3.It uses keyword 'struct' | 3.It uses keyword 'union' |
4.We can initialize values of member/s and in any order | 4.We can initialize that member which is first declared. |
5.It consumes more memory | 5.It consumes less memory. |
6.Its syntax struct tag { datatype member1; datatype member2; datatype member3; }variable; | 6.Its syntax union tag { datatype member1; datatype member2; datatype member3; }variable; |
Example struct student { int roll; char sex; float percentage; }var; | Example union student { int roll; char sex; float percentage; }var; |
3. a) Write a program to enter name, roll_number and marks of 10 students and store them in the file.[10]
Ans:-
#include<stdio.h>
int main()
{
FILE *p;
char name[100];
int roll_number;
int eng,phy,maths,chem,csc;
p=fopen("student.dat","w");
printf("enter name,roll_number and marks in eng,phy,maths,chem and csc\n");
printf("To exit ,press ctrl+z\n");
while((scanf("%s%d%d%d%d%d%d",name,&roll_number,&eng,&phy,&maths,&chem,&csc))!=EOF)
{
fprintf(p,"%s\t%d\t%d\t%d\t%d\t%d\t%d",name,roll,eng,phy,maths,chem,csc);
}
fclose(p);
printf("daat stored successfully\n");
return 0;
}
b) Write a program to enter 'n' number into one dimensional array and sort and display them in ascending order.[10]
Ans:-
/* program to sort 'n' numbers in ascending order and print them.
*/
#include <stdio.h>
int main()
{
int numbers[100];
int n,i,j,k;
printf("enter the size of n\n");
scanf("%d",&n);
printf("Enter numbers\n");
for(i=0;i<n;i++)
{
scanf("%d",&numbers[i]);
}
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
if(numbers[i]>numbers[j])
{
k=numbers[i];
numbers[i]=numbers[j];
numbers[j]=k;
}
}
}
printf("numbers in ascending order are=:\n");
for(i=0;i<n;i++)
{
printf("%d\n",numbers[i]);
}
return 0;
}
Group 'B' (Short Answer Questions) Attempt any five questions:[5x7=35]
4. What is the local area network? Explain the different types of topologies with diagrams.[2+5]
Ans:-
Local Area Network:-
It is a privately-owned network done in single building or room or office to share resources or data, documents (for 100 m).It occupies small area and small number of computers.Its Speed with which data is passed is extremely fast(1000mbps).It has Fastest connecting and sharing speed.For communication it uses medium like Co-axial or utp cable (mostly).
Preferd topologies can be topology like bus/star/tree etc.
There is fewer error occurrences during transmission and Less congestion.It can be handled by single person/administrator.
It is cost effective.
star topology:
A star topology is designed with each node (file server, workstations, and peripherals) connected directly to a central network hub, switch, or concentrator (See fig. 2).Data on a star network passes through the hub, switch, or concentrator before continuing to its destination. The hub, switch, or concentrator manages and controls all functions of the network.
It also acts as a repeater for the data flow. This configuration is common with twisted pair cable; however, it can also be used with coaxial cable or fiber optic cable.
Fig. 2. Star topology
Advantages of a Star Topology
Easy to install and wire.
No disruptions to the network when connecting or removing devices.
Easy to detect faults and to remove parts.
Disadvantages of a Star Topology
Requires more cable length than a linear topology.
If the hub, switch, or concentrator fails, nodes attached are disabled.
- Reduced chances of data collision as each node release a data packet after receiving the token.
- Token passing makes ring topology perform better than bus topology under heavy traffic.
- No need of server to control connectivity among the nodes.10. Describe the wireless network system. List out deices and equipment necessary for Wi-Fi network. 3+2
5. Who is a system analyst? Explain the major role of system analyst.[2+5]
Ans:-
The persons who perform above task/system analysis,design and implementation activity is know as system analyst. Somewhere we say or call by names like business engineer, business analyst etc. The work of system analyst who designs an information system is just same as an architect of a house. They work as facilitators of the development of information systems and computer applications.
6. What is normalization? Explain the normalization process with example.[2+5]
Ans:-
Some of the major benefits include the following :
- Greater overall database organization
- Reduction of redundant data
- Data consistency within the database
- A much more flexible database design
- A better handle on database security
- Fewer indexes per table ensures faster maintenance tasks (index rebuilds).
- Also realizes the option of joining only the tables that are needed.
1 NF:
A TABLE IS SAID TO BE IN 1n IF there is not repeating groups or information in a table..Here, repeating group means a set of columns that stores similar information that repeats in the same table.
Let’s consider following SQL commands.
Create table contacts
(
Contact Id Integer not null,
L_name varchar(20) not null,
F_name varchar(20)
Contact_date1 date,
Contact_desc1 varchar(50),
Contact_date2 date,
Contact_desc2 varchar(50),
);
We can see here in this table that there is a repeating group of date and description.
Now to convert into 1 N, we have to make a new table and shift that repeating group into new table.
Like,
Create table contacts
(
Contact_ID integer not null,
L_name varchar(20) not null,
F_name varchar(20)
);
Create table conversation
(
Contact_id integer not null,
Contact_date date,
Contact_desc varchar(50)
);
A table is said to be in 2 N if it is in 1N and there is no redundant data in table i.e. if a value of column is dependent on one column(primary key only) but not another.
For example:
Create table employee
(
Emp_no integer not null,
L-name varchar(20) not null,
F_name varchar(20),
Dept_code integer,
Description varchar(50),
);
This table contains redundant data i.e. the value of column(field) “description” depends on dept_code but does not depend on primary key “emp_no”.So let’s make a new table and shift them into that.
Create table employee
(
Emp_no integer not null,
L_name varchar(20) not null,
F_name varchar(20),
Dept_code integer,
);
Create table department
(
Dept_code integer not null,
Description varchar(50) not null,
);
We got two tables named employee and department with fields. Both the tables are related by primary key called dept_code. Now there is no redundancy and table is in 2N.
7. Differentiate between Internet and Intranet with suitable example.[2+5]
Ans:-
Differences are given in following paragraph.
7)We can say it as a “Centralized controlling system”.
8. Define the term polymorphism and inheritance with examples.[3.5+3.5]
Ans:-
9. Differentiate between while and do while loop.[3.5+3.5)
Ans:-
Differences between while and do..while loop are given below.
while loop | do while loop |
In the while loop, condition is checked in the beginning. | In the do while loop, condition is checked at the end. |
It is also known as a pre-test or entry control loop. | It is also known as post-test or exit control loop. |
It is not terminated with a semicolon. | It is terminated with a semicolon. |
In the while loop, statements are not executed if the condition is false. | In the do while loop, statements are executed once even the condition is false. |
It uses the keyword ‘while’. | It uses two keywords ‘do’ and ‘while’. |
The syntax of while loop is as follows: initialization; while(condition) { statements; increment/decrement; } | The syntax of do-while loop is as follows: initialization; do { statements; increment/decrement; }while(condition); |
The operation of while loop can be represented using flowchart as follows: | The operation of do while loop can be represented using flowchart as follows: |
Example: int main() { int i=1; while(i>=10) { printf("I love my country"); i++; } return 0; } Output: This program displays nothing as output; as condition is evaluated false in the beginning. | Example: #include<stdio.h> int main() { int i=1; do { printf("I love my country"); i++; }while(i>=10); return 0; } Output: This program displays “I love my country” as output at once. |
10. What is data security? How it can be implemented?[2+5]
Ans:-
Data security:-
- Physical: - It says about sites where data is stored must be physically secured.
- Human: - It is an authorization is given to user to reduce chance of any information leakage or manipulation.
- Operating system: We must take a foolproof operating system regarding security such that no weakness in o.s.
- Network: - since database is shared in network so the software level security for database must be maintained.
- Database system: - the data in database needs final level of access control i.e. a user only should be allowed to read and issue queries but not should be allowed to modify data
11. What is documentation? Explain the importance of documentation in program designing .[2+5]
Ans:-
Documentation:-
Suppose, we have finished development. while developing, the programmers write themselves some comments or remarks or guidelines just besides of code(or may be a separate file) or provide a separate manual which can be beneficial for them or any other programmer to understand the codes. So it is a supporting material/notes/helplines. It is must for developers to write from very beginning and in very simple manner such that IT and Non-IT persons can understand and modify if needed somewhere. It is also useful for the programmers who is/are new to a company and going to to do some changes in an existing system developed by some others.A documentation can be done for:
system manual: Includes relations to an environment and construction principles to be used in design of software components.installation,errors,recovery etc
program manual: it says about program and its components like,Technical - Documentation of code, algorithms, interfaces, and APIs.
users’ manual :User Documents give customers the information they need while using the product.
12. Write short notes on: [3.5+3.5]
a) cyber Law b) feasibility study [3.5+3.5)
Ans:-
a)Cyber Law:-
This law is commonly known as the law of the internet. It governs the legal issues of computers, Internet, data, software, computer networks and so on. These terms of legal issues are collectively known as cyberspace. In other words, it is a type of law which rules on the Internet to prevent Internet related crime.
Cyber law is a new and quickly developing area of the law that pertains to persons and companies participating in e-commerce development, online business formation, electronic copyright, web image trademarks, software and data licenses, online financial transactions, interactive media, domain name disputes, computer software and hardware, web privacy, software development and cybercrime which includes, credit card fraud, hacking, software piracy, electronic stalking and other computer related offenses.
1xbet korean betting site - Legalbet.co.kr
ReplyDelete1xbet korean betting site. Register now for the 1xbet apps first time and register an account and use the new bonus code WIN1030.
The Strip And Sands Casino | Proudly Owned by MGM
ReplyDeleteWhen 엠카지노에오신것을환영합니다 MGM Resorts International debuted in New York City in 2006, the casino became the 더킹 카지노 먹튀 premier m카지노에오신것을환영합니다 resort destination in the world 클레오카지노 of Las 샌즈 카지노 주소 Vegas,
Top 10 Online Casinos and Games - AprCasino
ReplyDelete› casino › casino Oct 2, 2021 — 바카라 사이트 Oct 2, 2021 Online casinos offer a range of games for free slots, progressive jackpots and 메리트 카지노 고객센터 real money jackpots. aprcasino.com What's the best online casino to play 실시간 바카라 사이트 위너바카라 real money slots and jackpot games? What's the best online casino to play 메리트 카지노 쿠폰 real money slots and jackpot games?