CS304 Assignment No 2 Solution Fall 2019 | Virtual Study Solutions

Adsetra Ads

 

CS304 Assignment No 2 Fall 2019

Dear Students, Here you can read or download CS304 - Object Oriented Programming Assignment No 2 Solution of Fall 2019. CS304 Assignment Due Date is 28 November 2019. Total Marks are 20. This assignment covers Lecture No 7 to 15. The Assignment Solution Sample Preview and Video Explanation have also been added.


Object Oriented Programming -  CS304 Assignment No 2 Solution of Fall 2019
Object Oriented Programming -  CS304 Assignment No 2 Solution of Fall 2019
We are here to facilitate your learning and we do not appreciate the idea of copying or replicating solutions. CS304 Assignment Solution File has been added. Previously we shareCS302 Assignment No 2 Solution Fall 2019.

CS304 Assignment Uploading instructions:

  • Your assignment should be in .CPP format (Any other formats like scan images, PDF, zip, doc, rar and bmp etc. will not be accepted).
  • Save your assignment with your ID (e.g. bc000000000.CPP).
  • No assignment will be accepted through email.

CS304 Assignment Rules for Marking:

It should be clear that your assignment will not get any credit if:
  • The assignment is submitted after due date.
  • The submitted assignment does not open, execute or file is corrupted.
  • Your assignment is copied from internet, handouts or from any other student.
  • (Strict disciplinary action will be taken in this case).

CS304 Assignment Question:

Consider the following part of class diagram which is showing composition relationship between League and Franchise classes.
CS304_Assignment_2_Fall_2019_figure_01
CS304_Assignment_2_Fall_2019_figure_01

CS304 Assignment Tasks to do:

You are required to write C++ code to create Franchise and League classes. Your classes should contain data members, constructors and member functions according to the given diagram. You also need to implement composition relationship between these classes.

Your output should be same as sample output.


CS304_Assignment_2_Fall_2019_figure_02
CS304_Assignment_2_Fall_2019_figure_02

CS304 Assignment No 2 Solution Fall 2019

You can see the Sample Preview of CS304 Assignment 1 Solution provided by (Virtual Study Solutions) below. Click on Download Button to Download Solution File in Your PC. Please Share it with your friends. You can also like our Facebook Page or Subscribe Us on YouTube for Latest Updates about Assignments and Past Papers.

we recommend you to read:

CS304 Past Papers Collection


Download  [  CS304 Mid Term Papers Solved by Moaaz ]  

Fall 2019 Assignment Solution:

CS401 Assignment No 2 Solution Fall 2019

ENG101 Assignment No 2 Solution Spring 2019 

CS304  Code Solution Sample Preview

CS304 Solution Code Sample Page Preview has been added below.

#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 :"<<naame<<endl;
    cout<<"League Year :"<<year<<endl;
    cout<<"League County :"<<country<<endl;
    cout<<"Franchise name :"<<french.getName()<<endl;
    cout<<"Frenchise City :"<<french.getCity()<<endl;
}


int main(){
league aleague("PSL", 2020,"PAKISTAN","Islamabad United","Islamabad");
aleague.displayInfo();
return 0;
}

Code output Preview:

cs304 assignment solution code output preview on Online C++ Compiler
cs304 assignment solution code output preview on Online C++ Compiler
 Solution has been tested on Online C++ Compiler:

Click Here to Verify the output : cpp.sh/7ckyg

Download CS304 Assignment No 2 Solution Fall 2019

File NameDownload Link
 CS304 Assignment No 2 Correct Solution Fall 2019.docx Download

Please Note : You assignment should be submitted in .CPP format.
Share your valuable feedback in comments section. Thank You.

Post a Comment

 

Top