ACC - Fundamentals of auditing and business
ACC311ACC501
ACF - (Accounting And Finance Related)
ACF619ACFI619
COM - (Commerce Related)
COM619COMI619
ECO - (Economics Related)
ECO401 ECO402 ECO403 ECO404
ENG - (English Related)
ENG001 ENG101 ENG201 ENG301 ENG401
ETH201 - Ethics (for Non-Muslims)
ETH201
ISL201 - Islamic Studies
ISL201
IT - (Info Tech Related
IT000IT0001IT430IT619ITI619
MIS - (Project And Internship Report)
MIS619 MISI619MIS620 MISI620
PAD - (Public Administration Related)
PAD619 PADI619
PAK301 - Pakistan Studies
PAK301PAK302
PHY - (Physics Related)
PHY101 PHY301
PSC201 - International Relations
PSC201PSC401
SOC - (Socialogy Related)
SOC101 SOC401
STA - (Statistics and Research)
STA301 STA630
URDU - (Urdu Related)
URD101
VUPROJECTS
AIOU PROJECTS
VUDESK TUBE
VUDESK APP
IT INTERNSHIPS FB Page
FB Group
DESK MEMBERS

APPLY NOW  | SIT (STEP IN SECURITY) | Ghrapical Password | Smart ETL Tool | SMS BLOCKER

#include<iostream>
#include <string>
#include<stdlib.h>
using namespace std;

//----------------defining Card class----------------------------
class Card{
//data member of Card class
char * ID;
char * Name;

//public interface of Card class
public:
// Default and overloaded constructors
Card();
Card(char * ID,char * Name);

// Setter and Getter fucntions
void set_Name();
void set_ID();

const char * get_Name() const;

void display_Card();

// Destructor
~Card();
// end of Card class
};

// Implementation of overloaded constructor
Card::Card(char * id,char * aname){


Name = new char[strlen(aname)+1];
strcpy(Name,aname);

ID = new char[strlen(id)+1];
strcpy(ID,id);

}

// Implementation of set_Name() method
void Card::set_Name(){
char name[50];
cout"\nEnter Card name:""\n";
cin.getline(name,50);

Name = new char[strlen(name)+1];
strcpy(Name,name);
}

// Implementation of get_Name() method
const char * Card::get_Name() const{
if(Name != NULL){
return Name;

}
}
// Implementation of set_add() method to set the value of ID
void Card::set_ID(){
char id[300];
cout"\nEnter ID:""\n";
cin.getline(id,300);

ID = new char[strlen(id)+1];
strcpy(ID,id);


}
// Implementation of Verify_Card() method, to varify a Card
void Card::display_Card() {
cout"\n\n -------------Card Display---------\n\n";
//----set_Name function call---------
set_Name();
//--------set_ID call---------
set_ID();
//------set status as verified----------
}
// Implementation of destructor
Card::~Card(){
delete []ID;
delete []Name;

}
int main(){

//Card object
Card Card1("",""); // Card class overloaded constructor is called
Card1.display_Card();
system("pause");
}

Views: 242

Replies to This Discussion

Advertise Here

kia ye sol thek hai?

Thanks.

RSS

Super Active Members 

Sponsers

VUDESK GROUPS

 

© 2019   Created by ʭIsmail Shahʭ.   Powered by

Badges  |  Report an Issue  |  Terms of Service