Navigation

    Cyberian
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Pro Blog
    • Users
    • Groups
    • Unsolved
    • Solved
    Quiz 100% Result
    • CS304 Assignment 1 Solution and Discussion Fall 2020

      zaasmi

      Re: CS304 Assignment 1 Solution and Discussion

      304 - Object Oriented Programming
    • CS304 Assignment 2 Solution and Discussion

      zaasmi

      Re: CS304 Assignment 2 Solution and Discussion

      Assignment No. 02
      Semester: Spring 2020
      CS304- Object Oriented Programming

      Total Marks: 20
      Due Date: 16/06/2020

      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.

      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).
      Lectures Covered:
      This assignment covers Lecture # 7-15.
      Problem Statement

      In Pakistan, universities have adopted the semester system for the purpose of education. In semester system, two types of formal exams (i.e. Mid Term Exam and Final Term Exam) are generally conducted in every semester. Each exam is composed of certain number of questions which can be of two types: multiple choice questions (MCQs) and descriptive questions.
      Keeping in mind the above scenario, consider the following class diagram showing the composition relationship between Exam and Question classes.
      8e1b1d68-b0fd-46e3-b1e6-6a6ffb7cd801-image.png

      Now, you are required to write a C++ program for above for above class diagram.
      Solution Guidelines:
      • Carefully analyze the given class diagram and write code according to classes, attributes, functions and relationship mentioned in class diagram.
      • In Exam class, data member NoOfQuestions will have some fixed value. It is set to 2 to generate the sample output.
      • As one Exam is composed of many questions, so here you have to use the concept of array of objects. Size of array will be based on value of Number of questions. It is set to 2 to generate the sample output.
      • In Question class, all getter functions should be constant.

      Sample Output:
      57df3c4f-f64a-47d7-a4dc-7a46b7435220-image.png

      Best of luck!
      NOTE: Do not put any query on MDB about this assignment, if you have any query then email at [email protected].
      Furthermore, if any student found cheating from any other student or from online forums then he/she will be awarded ZERO right away and strict disciplinary action will be taken against the student.
      Deadline: Your assignment must be uploaded/submitted on or before 16th June 2020.

      304 - Object Oriented Programming
    • CS304 Assignment 1 Solution and Discussion

      cyberian

      Re: CS304 Assignment 1 Solution and Discussion

      304 - Object Oriented Programming
    • CS304 Handouts pdf

      zaasmi

      CS304 Handout PDF

      304 - Object Oriented Programming
    • CS304 Assignment 1 Solution and Discussion

      zareen

      Assignment No. 01 (Graded)
      SEMESTER FALL 2019
      CS304- Object Oriented Programming Total Marks: 20
      Due Date: 15-11-2019
      Instructions
      Please read the following instructions carefully before solving & submitting assignment:
      It should be clear that your assignment will not get any credit if:
      o The assignment is submitted after due date.
      o The submitted assignment is other than .doc /.docx file.
      o The submitted assignment does NOT open or file is corrupted.
      o The assignment is copied (from other student or from handouts or internet).
      Objective
      The objective of this assignment is:
      o To give you the idea of practical implementation of some of the OOP concepts like abstraction, encapsulation, inheritance, association, generalization, specialization, and UML class construction.
      Problem Statement:
      PSL (Pakistan Super League) is played every year. This league contains at least 4-5 franchises and each franchise has a team. There are many sponsors which sponsor each franchise. Each team is composed of 10-15 players. One of the players is the captain of the team. A coach is also allocated to each team. One coach can serve only one team at a time. Coaches, captain and players are common persons each having different characteristics. Different games are played between the teams and each game has its venue and date.

      Draw an Object Model (Class Diagram) for the given scenario showing main objects, their attributes, functions and relationships.
      The tasks you have to do are:

      Extract the main objects (entities) of above system. Find the necessary attributes and functions that need to be associated with each object. Identify the relationships among identified objects. Construct a final comprehensive Class diagram showing all objects and their relationships along with their attributes and functions.

      Important things to consider:

      As happens in real world that everyone visualizes a problem in a different way so the solutions of all students may vary based upon their own thinking. You have to use standard UML notations for objects, classes, and their associations. You have to use all concepts studied so far like abstraction, encapsulation, inheritance, association, generalization, and specialization wherever applicable.
      Hint: Besides problem statement; objects, properties, and functions of a system can also be extracted from domain knowledge.
      Solution Uploading instructions
      o For clarity and simplicity, you are required to Upload/Submit only .DOC/.DOCX file
      o Copy/Paste your class diagram in your final MS Word (.doc) file if you are using any drawing tool (MS Paint, MS Visio etc.). Images submitted as solution files will not be accepted.

      NOTE:
      Do not put any query on MDB about this assignment, if you have any query then email at . Furthermore, if any student found cheating from any other student or from online forums then he/she will be awarded ZERO right away and strict disciplinary action will be taken against the student.

      Lectures Covered: This assignment covers Lecture # 1-6
      Deadline: Your assignment must be uploaded/submitted within due date i.e. 15th November, 2019.

      304 - Object Oriented Programming
    • CS304 Assignment 3 Solution and Discussion

      zareen

      Assignment No. 03
      Semester: Fall 2019
      CS304- Object Oriented Programming

      Total Marks: 20

      Due Date: 16/01/2020

      Objective
      The objective of this assignment is:
      To give you the idea of practical implementation of C++ Inheritance and Polymorphism.

      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.

      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).

      Lectures Covered:

      This assignment covers Lecture # 22-29.

      Assignment No. 03

      In continuation of scenario of PSL (Pakistan Super League) given in Assignment 1, you are required to write a C++ program that should contain three classes: Player, Batsman and Bowler, where Player should be base class and Batsman and Bowler should be its derived classes. The detail of data members and member functions for each class is provided in the given table.

      Class Data Members Member Functions Player • Name of Player, • Code of Player• Age of Player • Default Constructor • Setter functions to set values of data members of this class. • Getter functions to get the values of data members of this class. • A function to set data of a player. •A function to display data of a player. Batsman • Innings played • Runs Scored • Batting Average • Default Constructor • A function to set data of batsman. • A function to calculate batting average of a batsman. • A function to display data of a batsman. Bowler • Runs Conceded • Total Overs • Bowling Average • Default Constructor • A function to set data of bowler. • A function to calculate bowling average of a bowler. • A function to display data of bowler.

      Solution Guidelines:
      • You have to use concept of Polymorphism to generate the sample output.
      • Use following formulas to calculate Batting and Bowling average of batsman and bowler, where Total Innings and Total Overs should be non-zero.
      Batting Average = Runs Scored / Total Innings
      Bowling Average = Total number of runs conceded / Total Overs

      Sample Output:

      Best of luck!

      NOTE: Do not put any query on MDB about this assignment, if you have any query then email at [email protected]. Furthermore, if any student found cheating from any other student or from online forums then he/she will be awarded ZERO right away and strict disciplinary action will be taken against the student.

      Deadline: Your assignment must be uploaded/submitted on or before 16th Jan, 2020.

      304 - Object Oriented Programming
    • CS304 Assignment 2 Solution and Discussion

      zareen

      Assignment No. 02
      Semester: Fall 2019
      CS304- Object Oriented Programming

      Total Marks: 20

      Due Date: 28/11/2019

      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.

      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).

      Lectures Covered:

      This assignment covers Lecture # 7-15.

      Assignment
      Consider the following part of class diagram which is showing composition relationship between League and Franchise classes.
      9795b0c6-5a4d-4994-85bf-9928a2f4f01b-image.png

      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.

      Sample Output:
      1ad0921d-927b-4488-95bb-e95b87618a61-image.png

      Best of luck!

      NOTE: Do not put any query on MDB about this assignment, if you have any query then email at [email protected]. Furthermore, if any student found cheating from any other student or from online forums then he/she will be awarded ZERO right away and strict disciplinary action will be taken against the student.

      Deadline: Your assignment must be uploaded/submitted on or before 28th November 2019.

      304 - Object Oriented Programming
    • CS304 Final Term Current Paper

      zareen

      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 marks

      Shared by @Awais

      304 - Object Oriented Programming

    SOLVED CS304 Assignment 2 Solution and Discussion

    304 - Object Oriented Programming
    assignment 2 cs304 discussion fall 2019 solution
    1
    5
    15
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • zareen
      zareen Cyberian's Gold last edited by

      Assignment No. 02
      Semester: Fall 2019
      CS304- Object Oriented Programming

      Total Marks: 20

      Due Date: 28/11/2019

      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.

      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).

      Lectures Covered:

      This assignment covers Lecture # 7-15.

      Assignment
      Consider the following part of class diagram which is showing composition relationship between League and Franchise classes.
      9795b0c6-5a4d-4994-85bf-9928a2f4f01b-image.png

      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.

      Sample Output:
      1ad0921d-927b-4488-95bb-e95b87618a61-image.png

      Best of luck!

      NOTE: Do not put any query on MDB about this assignment, if you have any query then email at [email protected]. Furthermore, if any student found cheating from any other student or from online forums then he/she will be awarded ZERO right away and strict disciplinary action will be taken against the student.

      Deadline: Your assignment must be uploaded/submitted on or before 28th November 2019.

      1 Reply Last reply Reply Quote 0
      • zareen
        zareen Cyberian's Gold last edited by zareen

        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;
        }
        
        
        
        
        1 Reply Last reply Reply Quote 0
        • zareen
          zareen Cyberian's Gold last edited by zareen

          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;
          }
          
          
          
          
          1 Reply Last reply Reply Quote 0
          • zareen
            zareen Cyberian's Gold last edited by

            1 Reply Last reply Reply Quote 0
            • zareen
              zareen Cyberian's Gold last edited by zareen

              
              
                  #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();
              
                  }
              
              
              
              
                  #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;
                  }
              
              
              1 Reply Last reply Reply Quote 0
              • zareen
                zareen Cyberian's Gold last edited by

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post

                50% Off on Your FEE Join US!

                Quiz 100% Result If you want to know how you can join us and get 50% Discout on your FEE ask Cyberian in Chat Room! Quiz 100% Result Quiz 100% Result
                solution1241 discussion1193 fall 2019813 assignment 1425 assignment 2295 spring 2020265 gdb 1246 assignment 382 crw10174 spring 201955
                | |
                Copyright © 2021 Cyberian Inc. Pakistan | Contributors
                Live Chat