Skip to content

304 - Object Oriented Programming

3 Topics 27 Posts
  • CS304 Assignment 1 Solution and Discussion

    Solved cs304 assignment 1 solution discussion fall 2019
    4
    0 Votes
    4 Posts
    2k Views
    zareenZ
    Solution: [image: gSSeaWy.png]
  • 0 Votes
    4 Posts
    2k Views
    zareenZ
    Compile Online C++ Code
  • CS304 Assignment 2 Solution and Discussion

    Solved cs304 assignment 2 solution discussion fall 2019
    5
    0 Votes
    5 Posts
    2k Views
    zareenZ
    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; }
Reputation Earning
How to Build a $1,000/Month World CUP LIVE Matches Live Cricket Streaming
Sponsored
File Sharing
Stats

1

Online

3.1k

Users

2.8k

Topics

8.6k

Posts
Popular Tags
Online User
| |