CS304 Assignment 2 Solution Fall 2017
#1
CS304 Object Oriented Programming
Assignment 2 Solution 
Fall 2017


Solution:
Copy and Paste the following code in DevC++, save your file and then compile and run. 

Code:
#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);
}
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  CS304 Assignment 1 Solution Fall 2017 Pakistani 0 3,149 11-06-2017, 10:58 AM
Last Post: Pakistani
  CS304 GDB Solution Pakistani 2 2,964 07-28-2017, 07:54 AM
Last Post: Admin
  CS304 Quiz 1 Questions Solved Pakistani 1 2,842 05-22-2017, 10:33 PM
Last Post: Iram Rana
  CS304 Assignement 1 full Solution 2017 Rubaisha(Moody Girl) 0 2,485 04-28-2017, 09:34 PM
Last Post: Rubaisha(Moody Girl)
  CS304 Assignment 1 Solution - Fall 2016 Admin 1 3,160 11-10-2016, 08:45 AM
Last Post: Pakistani
  CS304 GDB Solution Rubaisha(Moody Girl) 0 1,915 08-10-2016, 01:05 PM
Last Post: Rubaisha(Moody Girl)
  CS304 GDB Admin 0 2,758 08-04-2016, 02:10 PM
Last Post: Admin
  CS304 assignment #3 2nd solution Rubaisha(Moody Girl) 0 898 07-30-2016, 07:47 PM
Last Post: Rubaisha(Moody Girl)
  CS304 Assignment #3 solution Rubaisha(Moody Girl) 4 2,300 07-30-2016, 12:35 PM
Last Post: Rubaisha(Moody Girl)
  Cs 304 assignment no 3 solution ppt slides 2016 dil 3 1,998 07-30-2016, 12:18 PM
Last Post: Admin



Users browsing this thread:
1 Guest(s)