www.vustudents.ning.com

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

# CS304 Object Oriented Programming Assignment No 02 Fall 2019 Solution & Discussion

CS304 Object Oriented Programming Assignment No 02 Fall 2019 Solution & Discussion

Views: 2012

### Replies to This Discussion

Our main purpose here discussion not just Solution

Students having same subject can start discussion here to solve assignment, GDB & Quiz and can clear their concepts until solution is provided.

P.S:    Please always try to add the discussion in proper format title like “CS101 Assignment / GDB No 01 Solution & Discussion Due Date: ___________”

Then copy Questions from assignment file and paste in Discussion.

http://bit.ly/vucodes (For Assignments, GDBs & Online Quizzes Solution)

http://bit.ly/papersvu (For Past Papers, Solved MCQs, Short Notes & More)

CS304 Object Oriented Programming Assignment 2 Solution & Discussion Fall 2019

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

class Franchise{
private:
string name;
string city;

public:
Franchise();
void setName(string);
void setCity(string);
string getName();
string getCity();
};

Franchise::Franchise(){

}
void Franchise::setName(string n){
name = n;
}

void Franchise::setCity(string c){
city = c;
}
string Franchise::getName(){
return name;
}

string Franchise::getCity(){
return city;
}

class league{
private:
string naame;
string country;
int year;
Franchise french;

public:
league(string , int, string , string , string);
void displayInfo();
};

league::league(string n, int y, string c, string name, string city){
naame = n;
country = c;
french.setCity(city);
city = french.getCity();
year = y;
french.setName(name);
name = french.getName();
}

void league::displayInfo(){
cout"League Name :"naameendl;
cout"League Year :"yearendl;
cout"League County :"countryendl;
cout"Franchise name :"french.getName()endl;
cout"Frenchise City :"french.getCity()endl;
}

i have an issue when i copiled it says source file not compiled

# CS-304 || 2nd Assignment || Solution ||Fall 2019||

AssalamoAlaikum
yeh solution to error day raha ha

kia error daita hay ?

source file not complied

function ka koi masla ha

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

class Franchise{
private:
string name;
string city;

public:
Franchise();
void setName(string);
void setCity(string);
string getName();
string getCity();
};

Franchise::Franchise(){

}
void Franchise::setName(string n){
name = n;
}

void Franchise::setCity(string c){
city = c;
}
string Franchise::getName(){
return name;
}

string Franchise::getCity(){
return city;
}

class league{
private:
string naame;
string country;
int year;
Franchise french;

public:
league(string , int, string , string , string);
void displayInfo();
};

league::league(string n, int y, string c, string name, string city){
naame = n;
country = c;
french.setCity(city);
city = french.getCity();
year = y;
french.setName(name);
name = french.getName();
}

void league::displayInfo(){
cout"League Name:"naameendl;
cout"League Year:"yearendl;
cout"League County :"countryendl;
cout"Franchise name:"french.getName()endl;
cout"Frenchise City:"french.getCity()endl;
}

int main(){

league l("PSL",2020,"Pakistan","Sargodha Eagles","Sargodha");
l.displayInfo();

}

1

2

## Latest Activity

+ ≋M≋S≋ posted a discussion

3 hours ago
11 hours ago
12 hours ago
12 hours ago
12 hours ago
12 hours ago
12 hours ago
12 hours ago