Wednesday, 11 April 2012

[discussion_vu] 19 Assignments Solutions Spring 2012

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

using namespace std;

class Khiladi{
public:
string KhiladiName;
int KhiladiScore;
Khiladi *Next;

Khiladi(string name, int scor)
{
this->KhiladiName = name;
this->KhiladiScore = scor;
this->Next=NULL;
}

};
Khiladi *Sirr;
int khiladies;

void NawaKhuladi(string name, int score)
{
Khiladi * current;
if(Sirr==NULL)
{
Sirr=new Khiladi(name, score);
++khiladies;
}
else
{
current=Sirr;
while(current->Next!=NULL)
{
current= current->Next;
}
current->Next = new Khiladi(name,score);
++khiladies;
}
}





void DikhaoSarayKhiladi()
{
Khiladi * current;
current=Sirr;
while(current !=NULL)
{
cout<< current->KhiladiName <<"\t\t\t";
cout<< current->KhiladiScore<<endl;
current= current->Next;
}

}

main(){

NawaKhuladi("abc",15);
NawaKhuladi("ccc",15);
DikhaoSarayKhiladi();

system("pause");
}
Quote this message in a reply

« Next Oldest | Next Newest »
Assalamu Alaykum Warahmatullahi WaBarakatuhu,
Here are all latest Assignment solutions of spring 2012.


--
You received this message because you are subscribed to the Google Groups "Virtual University of Pakistan" group.
To post to this group, send email to discussion_vu@googlegroups.com.
To unsubscribe from this group, send email to discussion_vu+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/discussion_vu?hl=en.

No comments:

Post a Comment