10-29-2011, 06:11 PM
Please help us about this assignment
|
CS301 Assignment no 1
|
|
10-29-2011, 06:11 PM
please please please its urgent so please
11-01-2011, 12:50 AM
where is the solution,,? today is due date..
11-02-2011, 01:45 AM
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"); }
also check the solution on ::
11-02-2011, 03:47 AM
i will see
11-02-2011, 03:48 AM
is it working i think it has lot of errors
11-02-2011, 04:54 AM
well it has errors but still u can get marks.
11-02-2011, 05:31 PM
nice work.....good
|
|
« Next Oldest | Next Newest »
|
| 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,581 |
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,423 |
11-27-2012, 04:59 AM Last Post: Xpert |
|
| Mcs cs402 1st assignment | chahat4all | 2 | 3,769 |
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 |
|