.... How to Find Your Subject Study Group & Join ....   .... Find Your Subject Study Group & Join ....  

We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Study Groups By Subject code Wise (Click Below on your university link & Join Your Subject Group)

[ + VU Study Groups Subject Code Wise ]  [ + COMSATS Virtual Campus Study Groups Subject Code Wise ]

Looking For Something at vustudents.ning.com?Search Here

complete solutions

I commented destruction part.

and please don't upload this .cpp other wise we both will ............. ,

ENJOYEEEEE

This Content Originally Published by a member of VU Students.

Views: 4796

See Your Saved Posts Timeline

Attachments:

Replies to This Discussion

mane ye program khud bnaya hai jo sulution dy rhy hain bht complex hai or eska solution bht he easy ha.

Output & program is here..

Attachments:

cs304 complete solution without errors may 2016

Attachments:

recName="";
recAddress ="";

senName="";
senAddress="";

};

Parcel::~Parcel()
{

//delete [] senAddress;
//delete [] senName;
//delete [] recName;
//delete [] recAddress;

};

int main(int argc, char * argv[]) {

int Id, weight, fee;
char senName[50],senAddress[100];
char recName[50], recAddress[100];

// create parcel calss object
Parcel parcel;

cout "Enter receipt no : "; cin >> Id;
parcel.ParcelId(Id);

cout "Enter Sender Name : "; cin.ignore(); cin.getline(senName, sizeof(senName)); parcel.senderName(senName); cout "Enter Sender Address : "; cin.ignore(-1); cin.getline(senAddress, sizeof(senAddress)); parcel.senderAddress(senAddress); cout "Enter Receiver Name : "; cin.ignore(-1); cin.getline(recName, sizeof(recName)); parcel.receiverName(recName); cout "Enter Receiver Address : "; cin.ignore(-1); cin.getline(recAddress, sizeof(recAddress)); parcel.receiverAddress(recAddress); cout "Enter weight (in grams) of a parcel : "; cin >> weight;
parcel.weight(weight);

cout "Enter Shipment Charges : "; cin >> fee;
parcel.fee(fee);

cout "\n\n Shipment Receipt"; cout "\n---------------------------"; cout "\n Receipt No. : " parcel.ParcelId(); cout "\n Sender Name : " parcel.senderName(); cout "\n Sender Address : " parcel.senderAdd(); cout "\n Receiver Name : " parcel.receiverName(); cout "\n Receiver Address : " parcel.receiverAdd(); cout "\n Parcel Weight (in grams) : " parcel.weight(); cout "\n Shipment Charges : " parcel.fee(); // Set parcel class data members system("pause");; }

#include <iostream>
using namespace std;
#include <string>


/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;

class Parcel
{

private:

// Parcel Details
int Id;
int pWeight, Fee;

// Sender 
char* senName;
char* senAddress;

// Reciver
char* recName;
char* recAddress;

// Let set/Assign values (Setter Functions)

public:

// Constructor

Parcel();

// Destructor

~Parcel();

// Set Parcel Details

void ParcelId (int ID)
{
Id = ID;
};

void weight (int wght)
{

pWeight = wght;

};
void fee (int fee)
{

Fee = fee;

};

// Set Sender Information

void senderName (char* sName)
{

senName = sName;

};

void senderAddress (char* sAddress)
{

senAddress = sAddress;

};

// Set Receiver Information

void receiverName (char* rName)
{
recName = rName;
};

void receiverAddress (char* rAddress)
{

recAddress = rAddress;

};


// Get Parcel Details 

int ParcelId()
{

return Id;
};

int weight()
{

return pWeight;

}
int fee()
{
return Fee;
};

char* senderName ()
{

return senName;

};

char* senderAdd()
{

return senAddress;
};

char* receiverName ()
{

return recName;

};

char* receiverAdd()
{

return recAddress;

}
};

// Constructor

Parcel:Tonguearcel()
{


Fee =0;
Id =0;
pWeight =0;

recName="";
recAddress ="";

senName="";
senAddress="";


};

Parcel::~Parcel()
{

//delete [] senAddress;
//delete [] senName;
//delete [] recName;
//delete [] recAddress;

};

int main(int argc, char * argv[]) {

int Id, weight, fee;
char senName[50],senAddress[100];
char recName[50], recAddress[100];

// create parcel calss object
Parcel parcel;


cout "Enter receipt no : ";
cin >> Id;
parcel.ParcelId(Id);


cout "Enter Sender Name : ";
cin.ignore();
cin.getline(senName, sizeof(senName));
parcel.senderName(senName);


cout "Enter Sender Address : ";
cin.ignore(-1);
cin.getline(senAddress, sizeof(senAddress));
parcel.senderAddress(senAddress);

cout "Enter Receiver Name : ";
cin.ignore(-1);
cin.getline(recName, sizeof(recName));
parcel.receiverName(recName);

cout "Enter Receiver Address : ";
cin.ignore(-1);
cin.getline(recAddress, sizeof(recAddress));
parcel.receiverAddress(recAddress);

cout "Enter weight (in grams) of a parcel : ";
cin >> weight;
parcel.weight(weight);

cout "Enter Shipment Charges : ";
cin >> fee;
parcel.fee(fee);

cout "\n\n Shipment Receipt";
cout "\n---------------------------";
cout "\n Receipt No. : " parcel.ParcelId();
cout "\n Sender Name : " parcel.senderName();
cout "\n Sender Address : " parcel.senderAdd();
cout "\n Receiver Name : " parcel.receiverName();
cout "\n Receiver Address : " parcel.receiverAdd();
cout "\n Parcel Weight (in grams) : " parcel.weight();
cout "\n Shipment Charges : " parcel.fee();

// Set parcel class data members






system("pause");;
}

RSS

Job's & Careers (Latest Jobs)

Admissions (Latest Admissons)

Scholarship (Latest Scholarships)

Internship (Latest Internships)

VU Study

Other Universities/Colleges/Schools Help

+ More Categorizes

© 2017   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service