CS304 Assignment Objective
The objective of this assignment is:- To give you the idea of practical implementation of some concepts like, the definition of classes, Data members, member functions, Constructors, Composition etc.
For any query about the assignment, contact at cs304@vu.edu.pkCS304 Assignment Problem Statement:
We have the following part of the class diagram showing composition relationship:
|
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 parameterizing 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 |
Deadline: Your assignment must be uploaded/submitted at or before November 24, 2017CS304 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.