Skip to main content

Re: ::: vuaskari.com ::: Any Solution for CS201 Assignment.

#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()
{
cout<<"\Welcome to Student Information System (Pakyouth)\n"<<endl;
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");
};
find attached the solution. plz made necessary changes

On Wed, Nov 2, 2011 at 2:36 PM, mc110200336 Raja Khurram Shahzad <mc110200336@vu.edu.pk> wrote:
Please share the solution .

thanks in advance

On Wed, Nov 2, 2011 at 9:35 AM, mc110402230 Suhail Ahmad Alvi <mc110402230@vu.edu.pk> wrote:


--
 
Sohail Ahmad Alvi.
 

--
We say, "Be one as Pakistani Nation and grow up for Pakistan's Future". Wish you all the best. Join www.vuaskari.com,
To post to this group, send email to vuaskari_com@googlegroups.com
Visit these groups:
This (Main) Group:http://groups.google.com/group/vuaskari_com?hl=en?hl=en
MIT/MCS Group: http://groups.google.com/group/vu_askarimit?hl=en?hl=en
HRM Group: http://groups.google.com/group/askari_hrm?hl=en?hl=en
Banking Group: http://groups.google.com/group/askari_banking?hl=en?hl=en
Management: https://groups.google.com/group/vuaskari_mgt?hl=en
Marketing: https://groups.google.com/group/vuaskari_mkt?hl=en
MIS Group: http://groups.google.com/group/askari_mis?hl=en

--
We say, "Be one as Pakistani Nation and grow up for Pakistan's Future". Wish you all the best. Join www.vuaskari.com,
To post to this group, send email to vuaskari_com@googlegroups.com
Visit these groups:
This (Main) Group:http://groups.google.com/group/vuaskari_com?hl=en?hl=en
MIT/MCS Group: http://groups.google.com/group/vu_askarimit?hl=en?hl=en
HRM Group: http://groups.google.com/group/askari_hrm?hl=en?hl=en
Banking Group: http://groups.google.com/group/askari_banking?hl=en?hl=en
Management: https://groups.google.com/group/vuaskari_mgt?hl=en
Marketing: https://groups.google.com/group/vuaskari_mkt?hl=en
MIS Group: http://groups.google.com/group/askari_mis?hl=en



--
Fida Saghar

--
We say, "Be one as Pakistani Nation and grow up for Pakistan's Future". Wish you all the best. Join www.vuaskari.com,
To post to this group, send email to vuaskari_com@googlegroups.com
Visit these groups:
This (Main) Group:http://groups.google.com/group/vuaskari_com?hl=en?hl=en
MIT/MCS Group: http://groups.google.com/group/vu_askarimit?hl=en?hl=en
HRM Group: http://groups.google.com/group/askari_hrm?hl=en?hl=en
Banking Group: http://groups.google.com/group/askari_banking?hl=en?hl=en
Management: https://groups.google.com/group/vuaskari_mgt?hl=en
Marketing: https://groups.google.com/group/vuaskari_mkt?hl=en
MIS Group: http://groups.google.com/group/askari_mis?hl=en

Comments

Popular posts from this blog

[vu-students] Urdu Love Letters ............ ahahahahahhahahah

  The One & Only .......... IRFAN. Italy. http://groups.yahoo.com/group/p_se_poetry   -- You received this message because you are subscribed to the Google Groups "VU Students" group. To post to this group, send email to vu-students@googlegroups.com To unsubscribe from this group, send email to vu-students+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/vu-students?hl=en_PK?hl=en

::: vuaskari.com ::: cs301

share cs301 midterm papers. -- We say, "Be one as Pakistani Nation and grow up for Pakistan's Future". Wish you all the best. Join www.vuaskari.com, To post to this group, send email to vuaskari_com@googlegroups.com Visit these groups: This (Main) Group: http://groups.google.com/group/vuaskari_com?hl=en?hl=en MIT/MCS Group: http://groups.google.com/group/vu_askarimit?hl=en?hl=en HRM Group: http://groups.google.com/group/askari_hrm?hl=en?hl=en Banking Group: http://groups.google.com/group/askari_banking?hl=en?hl=en Management: https://groups.google.com/group/vuaskari_mgt?hl=en Marketing: https://groups.google.com/group/vuaskari_mkt?hl=en MIS Group: http://groups.google.com/group/askari_mis?hl=en --- You received this message because you are subscribed to the Google Groups ":::www.vuaskari.com :::" group. To unsubscribe from this group and stop receiving emails from it, send an email to vuaskari_com+unsubscribe@googlegroups.com. ...

::: vuaskari.com ::: Fin622 All Mid Term Papers in just one file ....

just isi se tyari kr lo INSHA ALLAH 80% se above marks aye gay in MCQs....................... its gift for all VU finance students by me........ -- We say, "Be one as Pakistani Nation and grow up for Pakistan's Future". Wish you all the best. Join www.vuaskari.com, To post to this group, send email to vuaskari_com@googlegroups.com Visit these groups: This (Main) Group: http://groups.google.com/group/vuaskari_com?hl=en?hl=en MIT/MCS Group: http://groups.google.com/group/vu_askarimit?hl=en?hl=en HRM Group: http://groups.google.com/group/askari_hrm?hl=en?hl=en Banking Group: http://groups.google.com/group/askari_banking?hl=en?hl=en Management: https://groups.google.com/group/vuaskari_mgt?hl=en Marketing: https://groups.google.com/group/vuaskari_mkt?hl=en MIS Group: http://groups.google.com/group/askari_mis?hl=en