COMP122 Week 1 iLab - Introduction to Visual C++.NET and Basic Console Programming

Instructions for a week 1 iLab focusing on Visual C++.NET and basic console programming.

Ethan Wilson
Contributor
4.2
37
5 months ago
Preview (7 of 20 Pages)
100%
Purchase to unlock

Page 1

COMP122 Week 1 iLab - Introduction to Visual C++.NET and Basic Console Programming - Page 1 preview image

Loading page image...

1COMP122 Week 1 iLab-Introduction to Visual C++.NET and BasicConsole ProgrammingExplain the steps to create, compile, and run a C++ console-mode project in VisualC++.NET (2010), including how to handle common syntax errors andwarnings.Additionally, describe the importance of creating a test plan for verifying the program’scorrectness and how to compare predicted and actual outputs to identify logical errors.Word Count Requirement:300-400 words

Page 2

COMP122 Week 1 iLab - Introduction to Visual C++.NET and Basic Console Programming - Page 2 preview image

Loading page image...

Page 3

COMP122 Week 1 iLab - Introduction to Visual C++.NET and Basic Console Programming - Page 3 preview image

Loading page image...

2COMP122:Week 1 iLab-Part 1Introduction to Visual C++.NET (2010) IDEObjectivesAfter completing this assignment,you should:be able to create an empty console-mode project in VC++.NET;know how to enter, compile, build,andrun a C++ console-mode program;know some basic components of a C++ program,such as#include<iostream>;using namespace std;;int main( );return 0;; opening and closingbraces, { and }; and theintdata type;be able to usecinandcout.for simple text and numeric input and output;be able to use basic integer arithmetic operations, including modulus;knowthat integer division truncates;understand how the compiler reactsto several common syntax errors;understand the process of developing a test plan, including predicted output forspecific inputs (test cases);know how a program reacts to division by zero;know where the .exe file isstored after a successful build; andknow how to keep the Command Prompt window open at the end of a console-modeprogram.C++ Console-Mode Program Development ProcedureVisual C++is anIDE (Integrated Development Environment)for writing programs inC++. The object of this laboratory is to introduce you to the basic features of an IDE(source-code entry and editing, compiling, linking, and execution) and some basic C++programming statements to do some mathematical operations and simple input/output.WARNING:Accurate typing is the key to success here. Although the compiler is tolerantof extra "white space" (spaces, tabs,and blank lines), it is very fussy about other syntax(punctuation, keywords, variable names, upper and lower case requirements, etc.), so besure to type in the program belowexactlyas written,including case.In addition to showing how to create and run a program in VC++.NET, this exercisediscusseshow to test a program, which involvesselecting test inputs and predicting whatoutput the program should generate, thenobservingthe actual output,comparing the two,and analyzing any differences.

Page 4

COMP122 Week 1 iLab - Introduction to Visual C++.NET and Basic Console Programming - Page 4 preview image

Loading page image...

3Open Visual C++ .NETOpenMicrosoft Visual C++ 2010.NETby double-clicking on its icon.Figure1: When you open Visual C++ .NET, it should looksimilar to thisimage.You may find it convenient to maximize this screen if it is not already maximized.To set up your project,either selectFile->New->Projectfrom the menu, orclick onNewProjectin the upper-left part of the window.In theNew Projectwindow that isdisplayed, selectVisual C++-Win32as thetemplateon theleft-hand side of thiswindow.On the right-hand side of this window, selectWin32 ConsoleApplication.(NOTE: There are different project types, so be sure to select the correct one,Win32ConsoleApplication).On theNameline, enter the name of this project, e.g.Lab01.In

Page 5

COMP122 Week 1 iLab - Introduction to Visual C++.NET and Basic Console Programming - Page 5 preview image

Loading page image...

4theLocationline, enter thedirectory where you want your project to be stored.Yourscreen should look like the following:NOTE:If the Start Page (Figure 1) does not appear,click theHelpmenu and selectShow Start Page.Figure2: New Project Window

Page 6

COMP122 Week 1 iLab - Introduction to Visual C++.NET and Basic Console Programming - Page 6 preview image

Loading page image...

5ClickOK.If you see a pop-up window indicating that your project location cannot befully trusted, clickOK.Next, theWin32 Application Wizardwindow appears.It lookslike the following:Figure3:Initial Win32 Application WizardWindow

Page 7

COMP122 Week 1 iLab - Introduction to Visual C++.NET and Basic Console Programming - Page 7 preview image

Loading page image...

6Click theApplication Settingson the left-hand side of theWin32 ApplicationWizardwindow.TheApplication typeshould already beConsole application(select it if not),then,underAdditional options,selectEmpty project.The window should look likeFigure 4.Figure 4: Applications SettingsWindowof the Win32 Application Wizard
Preview Mode

This document has 20 pages. Sign in to access the full document!

Study Now!

XY-Copilot AI
Unlimited Access
Secure Payment
Instant Access
24/7 Support
Document Chat

Document Details

Related Documents

View all