CS304 Assignment No 2 Spring 2018
Dear Students, Here you can read or Download CS304 - Object Oriented Programming Assignment No 2 Solution Spring 2018. Assignment Due Date is 5 June, 2018. Total Marks are 20. This assignment covers lesson no. 1-8. We are here to facilitate your learning and we do not appreciate the idea of copying or replicating solutions. Assignment Solution File has been added. Previously we shared CS304 Assignment No 1 Solution Spring 2018.CS304 Assignment No 2 Solution and Discussion Spring 2018 |
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.
For any query about the assignment, contact at CS304@vu.edu.pk
Recommended : MTH001 Assignment No 1 Solution Spring 2018
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 Question:
Problem Statement:
We have the following part of class diagram showing composition relationship.CS304 Assignment No 2 Class diagram Spring 2018 |
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.
Please Note: See the sample output to view the messages you need to print in constructors of all classes.
Class Name
Functions
ABC Company
-Default constructor
HomePage
-Default constructor
Functions
ABC Company
-Default constructor
HomePage
-Default constructor
Items
-Default constructor
MenPage
-Default constructor
WomenPage
-Default constructor
Kidspage
-Default constructor
CS304 Assignment Sample Output:
CS304 Assignment No 2 Sample Output Spring 2018 |
CS304 Assignment No 2 Solution Spring 2018
You can see the Sample Preview of CS304 Assignment No 2 Solution provided by (Virtual Study Solutions) below. Click on Download Button to Download Solution File in Your PC. Please Share it with your friends. You can also like our Facebook Page or Subscribe Us below for Updates.Recommended : CS304 Solved MCQs with Reference
CS304 Assignment Solution Sample Preview
Solution Code Sample Page Preview has been added below with Solution File in .docx format and .cpp format.
Solution Code Written by : Azhar Shah
Solution Code Written by : Azhar Shah
#include <iostream> using namespace std; // Solution Idea by : www.virtualstudysolutions.blogspot.com class Menpage{ public: Menpage(){ cout << "Men Page Constructed\r\n"; } }; class Womenpage{ public: Womenpage(){ cout << "Women Page Constructed\r\n"; } }; class Kidspage{ public: Kidspage(){ cout << "Kids Page Constructed\r\n"; } }; class Items{ private: Menpage* Men_page; Womenpage* Women_page; Kidspage* Kids_page; public: Items(){ Men_page = new Menpage(); Women_page = new Womenpage(); Kids_page = new Kidspage(); cout << "Items Constructed\r\n"; } }; class Home_Page{ private: Items* items; public: Home_Page(){ items = new Items(); cout << "Home Page Constructed\r\n"; } }; class ABC_Company{ private: Home_Page* Home_page; public: ABC_Company(){ Home_page = new Home_Page(); cout << "ABC Company's website Constructed\r\n"; } }; /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char** argv) { ABC_Company* ABC_company; ABC_company = new ABC_Company(); return 0; }
CS304 Assignment Solution Sample Output
You can view the Sample Output of above given Code in the Image below. You can also test the code on Online Cpp Compiler by Clicking below:
Test the Code in C++ Shell
Solution Sample Output:
Solution Sample Output:
CS304 Assignment No 2 Solution Sample Output Spring 2018 |
Post a Comment