Lab Report 1
Lab Report 1
Lab No-01
Class: BESE-14A
SUBMITTED BY:
Task #1: Creating a Project in Visual Studio (to compile and run programs)
1. Click File in the top menu bar of Visual Studio, and then select the New... option, and select
project.
2. This will bring up a dialog box that contains many project possibilities.
Click on "Win32" under Visual C++ in the left pane of the window.
3. Select "Win32 Console Application" from the right pane of the window.
4. Enter a name for the project in the lower part of the window: Lab00
5. Now enter the name for the solution: CS110Labs. Press OK to create the solution and the
project.
6. A Win32 Application Wizard window will appear . Select "Application Settings" on the left
side of this window.
7. Under additional options, check the "Empty Project" box. Select Finish.
Task #2: Add some source code to this project
1. Right click the project Lab00 in Solution Explorer, and then select the Add > New Item
option
2. You should see a window with Installed Templates. Select Visual C++ > C++ File (.cpp).
3. Enter MyFirstProgram_v1.cpp in Name textbox. Press Add button
6. A lower window will show the results of this process. (As it is, MyFirstProgram_v1.cpp file
will compile successfully.) You will see an output like this. You should have 0 error(s).
7. To run (execute), select the Debug menu in the top menu bar. Select the option Start Without
Debugging.
8. A black ’DOS-type’ window will appear showing the output of your program.
To edit the source code (modify the program):
9. Modify the "Welcome to CS110!!" data to read something a little different, say "Greetings
human! Welcome to CS110!!"
10. To recompile, select the Build menu in the top menu bar. Select the option Rebuild Lab00.
11. A lower window will show the results of this process.
You wish to rerun the executable file created in the compilation process:
12. To run (execute), select the Debug menu in the top menu bar. Select the option Start Without
Debugging.
13. A black ’DOS-type’ window appears showing the new output of your program.
Task #3: Reviewing the Visual Studio Environment.
4. Since we have already copied the files to the right place you will see the icon of the file you
need to add. Select MyFirstProgram_v2.cpp. If you wish, by selecting the arrow beside the Look
in address box, you can navigate to the folder in which you saved the MyFirstProgram_v2.cpp
file. To see the C++ files in this folder, set the Files of type (see bottom box of Look in menu)
box to contain Visual C++ Files (which may already be the default value).
5. You should now see the name of this file (MyFirstProgram_v2.cpp) displayed under the folder
Source Files in the upper left panel.
1. Right click on the MyFirstProgram_v1.cpp and select remove. Removing does not mean
that you are deleting the file. The file is just removed from the project.
If you modify a file with a deliberate error, you can see what sort of message this error
generates when you try to recompile.