Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS301 Assignment no 1
#1
Please help us about this assignment


Attached Files
.doc   Fall 2011_CS301_1.doc (Size: 170 KB / Downloads: 203)
Reply
#2
please please please its urgent so please
Reply
#3
don't duplicate the posts.
[SIZE="3"]03009520262[/SIZE]
Rabeel Website
Reply
#4
where is the solution,,? today is due date..
Reply
#5
here is the solution tht shit net isnt helping u guyz????

#include <iostream.h>
#include <string.h>

using namespace std;
class Node{
public:
int value;
string Name;
Node * next;
Node(int a, string b)
{
this->value=a;
this->Name=b;
this->next=NULL;
}
};
Node *Head;


void addNod(int value, string name)
{
Node *p;
if(Head==NULL)
{
Head = new Node(value,name);
}
else
{
p=Head;
while(p->next!=NULL)
{
p=p->next;
}
p->next = new Node(value,name);
}
}
void SearchThis(string a)
{
while(Head->Name!=a)
{
Head=Head->next;
}
cout<<"found: "<< Head->value<<" "<<Head->Name<<endl;
}
void DeleteFunction(string nameToDelete)
{
Node *Current, *NextCurrent;


if(Head->Name==nameToDelete)
{
Current=Head;
Head=Head->next;
delete Current;
}
else
{
Current=Head;
while(Current!=NULL && Current->Name!=nameToDelete)
{
NextCurrent = Current;
Current = Current->next;
}
if(Current)
{
NextCurrent->next = Current->next;
delete Current;
}
}
}
void PrintList()
{
Node *Print;
Print = Head;
while(Print!=0)
{

cout<<Print->value<<" "<<Print->Name<<endl;
Print=Print->next;
}

}






int main()
{

int choice;
cout<<"1- Enter student information"<<endl;
cout<<"2- Search student by ID"<<endl;
cout<<"3- Search student by Name"<<endl;
cout<<"4- Delete student information"<<endl;
cout<<"5- Print all students"<<endl;
cout<<"6- Quit"<<endl;
int rol;
string na;
while(choice!=6)
{
cout<<"\n\n \t\tenter ur choice \n "<<endl;
cin>>choice;

if(choice==1)
{

cout<<"enter roll number ";
cin>>rol;
cout<<"enter name ";
cin>> na;
addNod(rol,na);
}
else if(choice==3){
cout<<"enter student name to search "<<endl;
cin>>na;
SearchThis(na);
}else if(choice==4){
cout<<"cout enter student name "<<endl;
cin>>na;
DeleteFunction(na);
}else if(choice==5){
PrintList();
}else if(choice==2){
cout<<"sorry, not codded this function "<<endl;
}else{
return 0;
}



}


system("pause");
}
Reply
#6
also check the solution on ::
Reply
#7
i will see
Reply
#8
is it working i think it has lot of errors
Reply
#9
well it has errors but still u can get marks.
Reply
#10
nice work.....good
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Need ACC501 - Business Finance Assignment No 2 Solution. Umar Abbas 2 4,251 02-07-2014, 08:23 PM
Last Post: Umar Abbas
  sta301 assignment 4 27 jun bc110200090 6 3,580 01-26-2013, 02:05 AM
Last Post: Vuhelper
  cs506 2nd assignment millee 0 2,661 12-04-2012, 11:30 PM
Last Post: millee
  cs506 2nd Assignment Neelam Ahmad 5 3,130 12-04-2012, 11:24 PM
Last Post: Vuhelper
  CS 504 Assignment 2 need help ommmi 24 11,422 11-27-2012, 04:59 AM
Last Post: Xpert
  Mcs cs402 1st assignment chahat4all 2 3,767 11-01-2012, 11:11 PM
Last Post: chahat4all
  eng201 assignment 4 due date 4/7/2012 bc110200090 6 2,615 07-03-2012, 03:51 PM
Last Post: bc110200090
  need CS304 4th assignment shazma 0 2,056 06-26-2012, 12:48 PM
Last Post: shazma
  sta301 assignment 4 solution vudecent 0 2,399 06-25-2012, 01:51 AM
Last Post: vudecent
  Required Soluction for 3rd Assignment of CS101 bc120200426 1 2,138 06-14-2012, 04:13 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)