Solution:
#include <iostream> using namespace std; class Franchise{ string name; string city; public: Franchise(){ name= ""; city=""; } void setname(string n){ name= n; } void setcity(string c){ city=c; } string getfname(){ return name; } string getfcity(){ return city; } }; class League{ private: string name; string year; string country; Franchise franchiseObject; public: League(string fname,string fcity,string n,string y,string c){ franchiseObject.setname(fname); franchiseObject.setcity(fcity); name=n; year=y; country=c; } void displayInfo(){ cout << "League name : " << name<<endl; cout << "League year : " << year<<endl; cout << "League country : " << country<<endl; cout << "Franchise name : " << franchiseObject.getfname()<<endl; cout << "Franchise city : " << franchiseObject.getfcity()<<endl; } }; int main() { League lg("Islamabad United","Islamabad","PSL","2020","PAKISTAN"); lg.displayInfo(); return 0; }UNSOLVED CS304 Final Term Current Paper
-
Today paper of cs304
1 Mcqs from past paper
18 mcqs from book
What is a constant function object? Write one example 3 marks
What is Multiple inheritance and give example? 3 marks
A person works that a company , id ,name and draw a composite and aggergation … and what is composition and aggergation 5 marks
[Get information] class program 5 marksShared by @Awais


100% Off on Your FEE Join US! Ask Me How?


