Today I am working on a short C++ lab about scopes and a intro to classes
Today I am working on a short C++ lab about scopes and a intro to classes. This is a very short 2 part lab. Thanks
in advance. ATTACHMENT PREVIEW Download attachmentA. Lab Activity # GSP115-A7B. Lab 7 of 7:Understanding Scope and Introducing Classes.C. Lab Overview – Scenario / Summary:TCO(s) that the lab supports:7Given a complex game problem, employ a complete menu-driven solution that includes a comprehensivestatement of the problem, complete program design, and program documentation, including comments.8Given a requirement for persistent data (such as saving a current game), design, code, and test a solutionalgorithm that reads input form the file and writes output to a file.Summary:You will experiment with code that demonstrates the concept of scope. You willexamine how a class is constructed.Learning outcomes:1.To be able to demonstrate an understanding of the effects of scope.2.To be able to discuss the key elements of a class.D. Deliverables:SectionDeliverablePart AStep 5. Program Listing and OutputPart BStep 5. Program Listing and OutputE. Lab Steps:Preparation:This lab requires Visual Studio 2012.qattachments_840cb6138e89c5d69fd0aac10ec392b346f17df9.docxPage 1

View the AnswerLab Activity:Part A:Programming Exercise 1Step 1:Start Visual Studio 2012□Start Visual Studio 2012□ClickFile|New|Projecton the menu barorclick theNew Projecticon on thetoolbar.□Click the black triangles to open choices on the left pane, if needed.Click onVisualC++.On the right pane, selectEmpty Project.□Give the project a name in the Name field near the bottom.For example, Week 7 iLabPart A would be an appropriate name.□Change the location of the project to your Desktop or USB drive or other appropriatelocation.You can change the location by clicking theBrowsebutton on the right sideof theLocationfield.□Click theOKbutton to create your project.□Open yourSolution Explorerby clickingView|Solution Exploreron the menu bar.□Right-click on theSource Filesfolder and selectAdd|New Item.□Click onC++ File (.cpp)and then give the file a name using theNamebox near thebottom.For example,main.cppwould be an appropriate name.Step 2:Scope□This is an exercise in check the scope of variables. Type or copy the following codeintomain.cpp.//Week 7 iLab Part A// Scope#include<iostream>#include<string>#include<time.h>usingnamespacestd;//******Global constants******conststringwhatStringIsThis =”I’m Global”;//******End of Global Constants******qattachments_840cb6138e89c5d69fd0aac10ec392b346f17df9.docxPage 2
