CIS247C Lab 4 New – Composition – Perfect Solution – Instant Delivery

Lab Price = $12
Please feel free to send us your queries at: support@iqrajavaid.com
Payment methods

Add to Cart

Buy Now

View Cart


Problem Statement

CIS247C
WEEK 4: LAB OVERVIEW
Lab Overview
Scenario/Summary
The purpose of this lab is to practice composition. We will create a Person class that has a Glasses composite attribute.
Deliverables
Create a Person class and a Glasses class. Copy the C++ source code and screenshots into a single Microsoft Word document. Remember to hold down the Alt key when you make your screenshots so that only the active window is copied.
Required Software
Microsoft Office: Word
Use a personal copy, or access the software at https://lab.devry.edu (Links to an external site.)Links to an external site..
Final Step (submitting your lab)
Visual Studio 2015
Use a personal copy, or access the software at https://lab.devry.edu (Links to an external site.)Links to an external site.. You can get a personal copy through the Student Software Store:
All Steps

Lab Steps
Step 1
Create a C++ project, and call it Week 4—Composition.
• Create a Glasses class using a separate header file and implementation file.
• Add the following attributes.
o Color (string data type)
o Prescription (float data type)
• Create a default constructor that sets default attributes.
o Color should be set to unknown because it is not given.
o Prescription should be set to 0.0 because it is not given.
• Create a parameterized constructor that sets the attributes to the given values.
• Create a destructor for the class.
• Create a toString( ) method.
o The toString( ) method should return a description of the object’s state (e.g., Color: Black, Prescription: 1.75).

 You can use the to_string( ) method to convert prescription to a string, or you can create a stringstream object. (Google for more info.)
• Create accessors and mutators for the attributes.
Help:
Transcript (Links to an external site.)Links to an external site.
Step 2
In this step, you will create a Person class with a Glasses composite attribute. The Person has a Glasses object.
• Create a Person class using a separate header file and implementation file.
• Add the following attributes.
o Name (string data type)
o SSN (string data type)
o myGlasses (Glasses data type)
• Create a default constructor that sets default attributes.
o Name should be set to unknown because it is not given.
o SSN should be set to unknown because it is not given.
o myGlasses should not be created because the attribute line creates a default Glasses object.
• Create a parameterized constructor that sets the attributes to the given values.
• Create a destructor for the class.
• Create a toString( ) method.
o The toString( ) method should return a description of the object’s state (e.g., Name: Bob, SSN: 555-55-5555, Glasses: [Color: Black, Prescription: 1.75]).
• Create a writeToFile( ) method with a string return message that saves the object’s state (current attribute values) to a file using the person’s name (e.g., Bob.txt).
• Create a readFromFile( ) method with a string return message that reads the object’s state from a file using the person’s name (e.g., Bob.txt).
• Create accessors and mutators for the attributes.
Help:
Part 1 (Links to an external site.)Links to an external site. – Part 2 (Links to an external site.)Links to an external site.
Step 3
Create a main method for your application to test the functionality of your Composition classes.
• Create a default Person object.
• Create a Glasses object using the parameterized constructor.
• Change the name and SSN of the default Person object.
• Change the myGlasses of the default Person object using the Glasses that you created.
• Display the changed Person object state using its toString( ) method.
• Change the myGlasses of the Person object using an anonymous Glasses object (on the fly).
• Display the changed Person object state using its toString( ) method.
• Show the prescription only for the Person object.
• Show the color of the glasses only for the Person object.
• Write the Person object’s state to the file using the writeToFile( ) behavior.
• Create a new default Person object.
• Set the name of the new Person to match the first Person object.
• Read the Person object’s state from the file using the readFromFile( ) behavior.
• Display the new Person object’s state using its toString( ) method.
Help:
Transcript (Links to an external site.)Links to an external site.
Step 4
Create a Microsoft Word document called Week 4 Lab. At the top, put your information, including your name, course, Week 4 Lab, and the date.
Run your application. Take screenshots while your application is running to demonstrate that it works properly. Remember to hold down the Alt key and the PrtScrn key at the same time (Alt + PrtScrn) to take screenshots of the active window only. Paste these screenshots into your Word document.
Put the file name for each file in the Word document below the screenshots. Bold the file name, and increase the font. Copy and paste the code for each file below its file name. You should have five files for your project (Source.cpp, Person.h, Person.cpp, Glasses.h, Glasses.cpp).
Submit the Word document to the Week 4 Lab page underneath Assignments.

Relevant Material
Screenshots
Screenshot: Lab 4

Screenshot: Lab 4

Instructions
* If you want to purchase multiple products then click on “Buy Now” button which will give you ADD TO CART option.Please note that the payment is done through PayPal.
* You can also use 2CO option if you want to purchase through Credit Cards/Paypal but make sure you put the correct billing information otherwise you wont be able to receive any download link.
* Your paypal has to be pre-loaded in order to complete the purchase or otherwise please discuss it with us at support@iqrajavaid.com.
* As soon as the payment is received, download link of the solution will automatically be sent to the address used in selected payment method.
* Please check your junk mails as the download link email might go there and please be patient for the download link email. Sometimes, due to server congestion, you may receive download link with a delay.
* All the contents are compressed in one zip folder.
* In case if you get stuck at any point during the payment process, please immediately contact us at support@iqrajavaid.com and we will fix it with you.
* We try our best to reach back to you on immediate basis. However, please wait for atleast 8 hours for a response from our side. Afterall, we are humans.
* Comments/Feedbacks are truely welcomed and there might be some incentives for you for the next lab/quiz/assignment.
* In case of any query, please donot hesitate to contact us at support@iqrajavaid.com.
* MOST IMPORTANT Please use the tutorials as a guide and they need NOT to be used for any submission. Just take help from the material.
******************************************** Good Luck ***************************************************
Privacy Policy
We take your privacy seriously and will take all measures to protect your personal information.
Any personal information received will only be used to fill your order. We will not sell or redistribute your information to anyone.
Refund Policy
Incase you face any issues with the tutorial, please free to contact us on support@iqrajavaid.com
We will try our best to resolve the issue and if still persists we can discuss for a refund in case its required.
Payment Details
Lab Price = $12
Please feel free to send us your queries at: support@iqrajavaid.com

Payment methods

Add to Cart

Buy Now

View Cart