CS304 Assignment No 2 Solution Fall 2017 | Virtual Study Solutions

Adsetra Ads

 

CS304 Assignment No 2 Fall 2017

Dear Students, CS304 Assignment Solution has been added. Here you can read or Download CS304 - object oriented programming Assignment No 2 Solution and Discussion of Semester Fall 2017. Assignment Due Date is 24 November, 2017. Total Marks are 20. This assignment covers Lecture No 7 to Lecture No 15. Previously we shared CS304 Solved MCQs with Reference.

CS304 Assignment No 2 Solution Fall 2017
CS304 Assignment No 2 Solution Fall 2017

CS304 Assignment Instructions:

  • Please read the following instructions carefully before submitting assignment:
  • It should be clear that your assignment will not get any credit if:
  • The assignment is submitted after due date.
  • The assignment is submitted via email.
  • The assignment is copied from Internet or from any other student.
  • The submitted assignment does not open or file is corrupt.
  • It is in some format other than .cpp.
Please Note: You are supposed to submit your assignment in .cpp format. Any other formats like scan images, PDF, zip, doc, rar and bmp etc will not be accepted. All types of plagiarism are strictly prohibited.

Recommended : All CS Subjects Mid Term Past Papers Collection

CS304 Assignment Objective

The objective of this assignment is:
  • To give you the idea of practical implementation of some concepts like, definition of classes, Data members, member functions, Constructors, Composition etc.
For any query about the assignment, contact at cs304@vu.edu.pk

CS304 Assignment Problem Statement:

We have the following part of class diagram showing composition relationship:

CS304 Assignment No 2 Class Diagram
CS304 Assignment No 2 Class Diagram

You are required to implement above class diagram (complete program) in C++ with all data members, constructors, member functions and concept (composition) given in the class diagram/table 1.

See the sample output to view the messages you need to print in constructors of all classes. In case of parameterize constructors, you can select any of data member(s) according to the type of constructor.




Class Name
Attribute Name
Attribute Data Type
Functions

WebSite

name

Character
-Default constructor
-One parameter overloaded constructor ()

WebPage
width
Double
-Default constructor
--Two parameter overloaded constructor ()

height

Double
   
    Links
       
        name

Character
Default constructor
-One parameter overloaded constructor ()









Table 1: Classes

Sample Output
CS304 Assignment No 2 Sample output
CS304 Assignment No 2 Sample output
Deadline: Your assignment must be uploaded/submitted at or before November 24, 2017

CS304 Assignment No 2 Solution Fall 2017

You can see the sample Solution file page preview below. and You can easily Download CS304 Assignment Solution File from the Download Button given below:

Solution Main Idea Source Code 

Shared by : Muhammad Arsalan

#include <iostream>
#include <stdlib.h>
using namespace std; 

class website
{
 char *name;
 public:
 website()
 {
  cout <<"Website default constructor is called\n\n";
 }
 website(char *Name)
 {
  cout <<"\nwebsite perameterized constructor is called!";
 }
};

class webpage
{
 double width; 
 double height; 
 public:
 webpage()
 {
  cout << "\nWebpage default constructor is called";
 }
 webpage(double x,  double y) 
 {
  cout<< "\nWebpage Perameterized constructor is called!";
 }
};

class links
{
 char *name;
 public:
 links ()
 {
  cout << "\nlink default constructor is called";
 }
 links (char *Name)
 {
  cout << "\nlink perameterized constructor is called!";
 }
};

int main()
{
 webpage aweb;
 links alink;
 cout << endl << endl; 
 webpage aweb1;
 links alink1;
 cout << endl << endl; 
 webpage aweb2;
 links alink3;
 cout << endl; 
 webpage aweb11(112, 512);
 links alink11("A");
 website awebsite11("A");
 cout << endl << endl ;
 system ("pause");
 return (0);
}

CS304 Assignment Solution Download Link

We are here to facilitate your learning and we do not appreciate the idea of copying or replicating solutions.
Download

If CS304 Assignment No 2 Solution provided by (Virtual Study Solutions) was helpful. Please Share it with your friends. You can also like our Facebook Page or Subscribe Us below for Updates. Thank You.

Post a Comment

 

Top