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 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.
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.
CS304 Assignment Problem Statement:
We have the following part of class diagram showing composition relationship:CS304 Assignment No 2 Class Diagram |
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 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.
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.
إرسال تعليق