Sie sind auf Seite 1von 11

MCSL-025

SR

Email: imsubhankar93@gmail.com

PLEASE VERIFY BEFORE WRITING.. I WILL NOT BE TAKE ANY


RESPONSIBLE IF ANY WRONG REVIEW BY THE EVALUATOR!!!!
PART-1: MCS-021
1. Write a program in C language for addition of two numbers which have at least 20 digits each.
(5 marks)
Coming Soon.
2. Write a program in C language that will accept a Graph as input and will generate its Minimum Cost
Spanning Tree.
/* Program for creating a minimum spanning tree from Kruskal's algorithm */
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#define MAX 20
struct edge
{
int u;
int v;
int weight;
struct edge *link;
}*front = NULL;
int father[MAX]; /*Holds father of each node */
struct edge tree[MAX]; /* Will contain the edges of spanning tree */
int n; /*Denotes total number of nodes in the graph */
int wt_tree=0; /*Weight of the spanning tree */
int count=0; /* Denotes number of edges included in the tree */
/* Functions */
void make_tree();
void insert_tree(int i,int j,int wt);
void insert_pque(int i,int j,int wt);
struct edge *del_pque();
create_graph()
{
int i,wt,max_edges,origin,destin;
printf("Enter number of nodes : ");
scanf("%d",&n);
max_edges=n*(n-1)/2;
for(i=1;i<=max_edges;i++)
{
printf("Enter edge %d(0 0 to quit): ",i);
scanf("%d %d",&origin,&destin);

MCSL-025

SR

Email: imsubhankar93@gmail.com

PLEASE VERIFY BEFORE WRITING.. I WILL NOT BE TAKE ANY


RESPONSIBLE IF ANY WRONG REVIEW BY THE EVALUATOR!!!!
if( (origin==0) && (destin==0) )
break;
printf("Enter weight for this edge : ");
scanf("%d",&wt);
if( origin > n || destin > n || origin<=0 || destin<=0)
{
printf("Invalid edge!\n");
i--;
}
else
insert_pque(origin,destin,wt);
}/*End of for*/
if(i<n-1)
{
printf("Spanning tree is not possible\n");
exit(1);
}
}/*End of create_graph()*/
void make_tree()
{
struct edge *tmp;
int node1,node2,root_n1,root_n2;
while( count < n-1) /*Loop till n-1 edges included in the tree*/
{
tmp=del_pque();
node1=tmp->u;
node2=tmp->v;
printf("n1=%d ",node1);
printf("n2=%d ",node2);
while( node1 > 0)
{
root_n1=node1;
node1=father[node1];
}
while( node2 >0 )
{
root_n2=node2;
node2=father[node2];
}
printf("rootn1=%d ",root_n1);
printf("rootn2=%d\n",root_n2);

MCSL-025

SR

Email: imsubhankar93@gmail.com

PLEASE VERIFY BEFORE WRITING.. I WILL NOT BE TAKE ANY


RESPONSIBLE IF ANY WRONG REVIEW BY THE EVALUATOR!!!!
if(root_n1!=root_n2)
{
insert_tree(tmp->u,tmp->v,tmp->weight);
wt_tree=wt_tree+tmp->weight;
father[root_n2]=root_n1;
}
}/*End of while*/
}/*End of make_tree()*/
/*Inserting an edge in the tree */
void insert_tree(int i,int j,int wt)
{
printf("This edge inserted in the spanning tree\n");
count++;
tree[count].u=i;
tree[count].v=j;
tree[count].weight=wt;
}/*End of insert_tree()*/
/*Inserting edges in the priority queue */
void insert_pque(int i,int j,int wt)
{
struct edge *tmp,*q;
tmp = (struct edge *)malloc(sizeof(struct edge));
tmp->u=i;
tmp->v=j;
tmp->weight = wt;
/*Queue is empty or edge to be added has weight less than first edge*/
if( front == NULL || tmp->weight < front->weight )
{
tmp->link = front;
front = tmp;
}
else
{
q = front;
while( q->link != NULL && q->link->weight <= tmp->weight )
q=q->link;
tmp->link = q->link;
q->link = tmp;
if(q->link == NULL)
/*Edge to be added at the end*/
tmp->link = NULL;
}/*End of else*/
}/*End of insert_pque()*/

MCSL-025

SR

Email: imsubhankar93@gmail.com

PLEASE VERIFY BEFORE WRITING.. I WILL NOT BE TAKE ANY


RESPONSIBLE IF ANY WRONG REVIEW BY THE EVALUATOR!!!!

/*Deleting an edge from the priority queue*/


struct edge *del_pque()
{
struct edge *tmp;
tmp = front;
printf("Edge processed is %d->%d %d\n",tmp->u,tmp->v,tmp->weight);
front = front->link;
return tmp;
}/*End of del_pque()*/
void main()
{
int i;
create_graph();
make_tree();
printf("Edges to be included in spanning tree are :\n");
for(i=1;i<=count;i++)
{
printf("%d->",tree[i].u);
printf("%d\n",tree[i].v);
}
printf("Weight of this minimum spanning tree is : %d\n", wt_tree);
}/*End of main()*/

PART-2: MCS-022
1. Write a shell script in Linux/Unix that accepts a text file as input and prints the number of words in
the file which have at least one vowel as output. (5 marks)
Coming Soon.

MCSL-025

SR

Email: imsubhankar93@gmail.com

PLEASE VERIFY BEFORE WRITING.. I WILL NOT BE TAKE ANY


RESPONSIBLE IF ANY WRONG REVIEW BY THE EVALUATOR!!!!

2. Your PC is on a network. Connect a Printer physically to your PC.


Source Link :

http://www.pcadvisor.co.uk/how-to/network-wifi/how-to-connect-to-a-printer-on-your-local-network3272460/

PLEASE VERIFY BEFORE WRITING.. I WILL NOT BE TAKE ANY


RESPONSIBLE IF ANY WRONG REVIEW BY THE EVALUATOR!!!!

Step one
From the Start Menu, select Control Panel, followed by View devices and printers.

Step two
Click on Add a printer, which is located at the top of the window, and then from the option displayed, choose Add a network,
wireless or Bluetooth printer.

MCSL-025

SR

Email: imsubhankar93@gmail.com

PLEASE VERIFY BEFORE WRITING.. I WILL NOT BE TAKE ANY


RESPONSIBLE IF ANY WRONG REVIEW BY THE EVALUATOR!!!!

Step three
Windows will now scan your network and identify the printers that have been made available to share (more on this below).
Select the printer you want to access from the list and press Next.

Step four
Windows will now connect to the printer and look for the driver. Once it has located the driver, youll be asked to confirm you
trust the printer, and then the driver will be installed on your machine. A pop-up will confirm your PC is now connected to the
printer. Press Next. Youll be given the option to print a test page. Alternatively, press Finish to begin using the printer.

Step five
If youve got a local printer connected to your machine, you can also opt to share it with other PCs on the network. First,
youll need to check printer sharing is switched on. Open the Start menu and head to the Control Panel again.
Step six
Click on Network and internet and, from the options displayed, choose Network and Sharing Centre. From the options on the
left-hand side, select Change advanced sharing settings.

MCSL-025

SR

Email: imsubhankar93@gmail.com

PLEASE VERIFY BEFORE WRITING.. I WILL NOT BE TAKE ANY


RESPONSIBLE IF ANY WRONG REVIEW BY THE EVALUATOR!!!!

Step seven
Make sure Turn on file and printer sharing is selected, then press Save changes, Close window. Now, once again open the
Start Menu and select the Control Panel.

Step eight
From the list choose View devices and printers, and then right-click on the icon of the printer you want to share.

Step nine
Select Printer properties and then click the Sharing tab. From here tick the box next to Share this printer. Click OK and now
the printer can be used by other machines on the network.

MCSL-025

SR

Email: imsubhankar93@gmail.com

PLEASE VERIFY BEFORE WRITING.. I WILL NOT BE TAKE ANY


RESPONSIBLE IF ANY WRONG REVIEW BY THE EVALUATOR!!!!
PART-3: MCS-023
1. Create a database consisting of Name of Alumni, Organization, Designation, Programme of Study,
Year of Passing, Enrollment Number, Employment Status After creating the database, list the
number of Alumni who have done MCA
TABLE CREATION
CREATE TABLE EMP
(
ENRMNT_NO NUMBER PRIMARY KEY NOT NULL,
EMP_NAME VARCHAR2(30),
DESIGNATION VARCHAR2(20),
PROG_OF_STUDY VARCHAR2(30),
ORGANIZATION VARCHAR2(50),
YEAR_OF_PASSING NUMBER,
EMP_STATUS VARCHAR2(20)
);

TABLE INSERTION:1.INSERT INTO EMP VALUES(151425369,'SORAV GHOSH','FACULTY','BCA','SOFT INDIA TECH',2005,'EMPLOYEED');


2.INSERT INTO EMP VALUES(151359881,'UTPAL SINGH','CORODINATOR','MCA','INDIAN INST OF
CYBERCRIME',2010,'SELF-EMPLOYEED');

ENRM N T_N O

EMP _N AME

DES IGN ATION

PR OG _O F_S TUD Y

OR G AN I ZATI ON

YE AR _O F_P ASSI N G

EMP _S TATUS

151425369

SOURAV GHOSH

FACULTY

BCA

SOFT INDIA TECH

2005

EMPLOYEED

151359881

UTPAL SINGH

CORODINATOR

MCA

INDIAN INST OF
CYBERCRIME

2010

SELFEMPLOYEED

142536859

SUSMITA ROY

MANAGER

MCA

REGINAL CENTRE

2004

EMPLOYEED

123659894

SUDIPTA
CHAKRABORTY

ASST
PROFESSOR

BBA

CP TECHNET

2013

EMPLOYEED

101236526

RIMPA ROY

GUESTLECTURER

MA

VICTORIA
INSTITUATION

2009

SELFEMPLOYEED

113456989

SUBHANKAR
BANERJEE

PROFESSOR

MTECH

APC COLLEGE

2014

EMPLOYEED

111569456

KOUSTUV GHOSH

LAB ASSISTANT

MCA

CALCUTTA UNIV

2014

SELFEMPLOYEED

123654125

SUDIPTO SINGHA

FACULTY

M.Sc

WBSU

2015

EMPLOYEED

MCSL-025

SR

Email: imsubhankar93@gmail.com

PLEASE VERIFY BEFORE WRITING.. I WILL NOT BE TAKE ANY


RESPONSIBLE IF ANY WRONG REVIEW BY THE EVALUATOR!!!!
QUERY
List the number of Alumni who have done MCA

SELECT EMP_NAME,PROG_OF_STUDY FROM EMP WHERE PROG_OF_STUDY='MCA';


EMP _N AME

PR OG _O F_S TUD Y

UTPAL SINGH

MCA

SUSMITA ROY

MCA

KOUSTUV GHOSH

MCA

PART-4: MCS-024
1. Write a program in Java for the addition of two sparse matrices. (5 marks)
import java.util.*;
class sparsemat
{
void add()
{
int spars[][]=new int[5][6];
int spars1[][]=new int[5][6];
int spars3[][]=new int[5][6];
int r,c,i,j,val,val1;
Scanner sc=new Scanner(System.in);
System.out.println("Enter the dimenssions of Sparse MAtrixx:");
System.out.println("Enter the number of row :");
r=sc.nextInt();
System.out.println("Enter the number of colomn:");
c=sc.nextInt();

for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
if(i==j)
{
System.out.println("Enter the value:");
val=sc.nextInt();
spars[i][j]=val;
}

MCSL-025

SR

Email: imsubhankar93@gmail.com

PLEASE VERIFY BEFORE WRITING.. I WILL NOT BE TAKE ANY


RESPONSIBLE IF ANY WRONG REVIEW BY THE EVALUATOR!!!!
}
}
System.out.println("The elements of First Sparse MAtrixx:");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
System.out.printf("%d",spars[i][j]);
}
System.out.println();
}
System.out.println("Enter the number of row of 2nd matrixx :");
r=sc.nextInt();
System.out.println("Enter the number of colomn of 2nd matrixx:");
c=sc.nextInt();
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
if(i==j)
{
System.out.println("Enter the value:");
val1=sc.nextInt();
spars1[i][j]=val1;
}
}
}
System.out.println("The elements of 2nd Sparse MAtrixx:");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
System.out.printf("%d",spars1[i][j]);
}
System.out.println();
}
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)

MCSL-025

SR

Email: imsubhankar93@gmail.com

PLEASE VERIFY BEFORE WRITING.. I WILL NOT BE TAKE ANY


RESPONSIBLE IF ANY WRONG REVIEW BY THE EVALUATOR!!!!
{
spars3[i][j]=spars1[i][j]+spars[i][j];
}
}
System.out.println("Addition is");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
System.out.printf("%d",spars3[i][j]);
}
System.out.println();
}
}
}
class addition
{
public static void main(String args[])
{
sparsemat s1=new sparsemat();
s1.add();
}
}

2. Write a program in Java that connects to a database and generates a report consisting of the courses
study center wise where the student attendance to theory classes is at least 50%.Make assumptions
wherever necessary.

Coming Soon

===========THANX TO SR============

Das könnte Ihnen auch gefallen