Homework: Visual Studio

    Next >

Note: To submit this homework, you need to use your personal CS account. The username for your personal CS account is the same as your pipeline ID (usually two to three letters, a single digit followed by a letter). If you don't have a CS account that matches your pipeline ID, request one at https://mgt.cs.mtsu.edu/aru/. It may take a day or two to create your account!

Introduction

The purpose of this assignment is to help you become (or verify that you are) familiar with Microsoft Visual Studio 2012.

Creating a project

  1. To create a new project, select File::New::Project ...::Visual C++::Win32 Console Application (meaning the File menu option, then New menu item, etc.)
  2. Give your project a name (e.g., carroll-hwkVisualStudio).
  3. Select an appropriate drive location (i.e., your flash drive).
  4. Make sure "Create directory for solution" checkbox is NOT checked.
  5. Click the "OK" button.
  6. Click the "Next" button.
  7. Under "Application type" select "Console Application".
  8. Under "Additional options" select "Empty Project" (if you don't it will create several files).
  9. Click the "Finish" button.

Creating files and adding them to a project

  1. Select Project::Add New Item ...
  2. Select the type of files that you are creating. (Code::C++ file (.cpp) or C++ header file (.h))
  3. Give your file a name.
  4. Click "Add".
  5. Type in the code in the editor window.
  6. Save the code (CTRL + S).

Adding existing files to a project

Visual Studio can link files that already exist on a computer to be part of your project. Linking does not copy the files into project. To ensure that the files are submitted with your project use the following steps.
  1. Make a new directory named src within the project directory (e.g., carroll-hwkVisualStudio/src).
  2. Copy the file(s) that you wish to include into the project into src.
  3. Select Project::Add Existing Item ...
  4. Select the file(s) in the src directory that you want to add.
Do not use "Add existing files" for projects that you're going to submit. The problem is when you make the zip file, the actual file is NOT in that directory and therefore it is not in the zip file!

How to create the executable file

  1. Click Build::Build Solution or Build::Rebuild Solution. (Compiles and links)

How to execute your program

  1. After an executable file have been created (program has been compiled and linked successfully), press CTRL + F5 or select Debug::Start Without Debugging.

Assignment

  1. Read the following tutorial steps above for creating a C++ project in Visual Studio.
  2. Name your project <yourlastname>-hwkVisualStudio. For example, if my last name were Carroll (and it is), then for me it would be carroll-hwkVisualStudio.
  3. Create new files into your project that have the same new and contents as the following:
  4. Compile and execute your project and make sure you assignment works properly.
  5. When you are read to submit your assignment, close Visual Studio and delete the debug and ipch folders and .sdf (SQL Server Compact Edition Database) files in the project folder (if they're present). (These directories and files will be automatically regenerated if needed.)
  6. Zip the whole project directory (e.g., by right-clicking on the folder and choosing send to::Compressed (zipped folder) in Windows Explorer). Name your zip file as hwkVisualStudio.zip. If you added existing files instead of creating new files, make sure that they are contained in the project directory.
  7. Your program must compile and run in both Visual Studio 2012 or newer and on ranger. On ranger, it must compile with the following command:
    g++ -std=c++0x *.cpp -o hwkVisualStudio
  8. Submit the assignment (see instructions below).

Notes

Submission

Submit your zip file at https://3110.cs.mtsu.edu/ (using your "personal" CS account credentials). For further instructions, please see the Miscellaneous page.

Rubric:

Points          Item
----------      --------------------------------------------------------------
_____ /  2      Project has appropriate files added
_____ /  2      Removed debug and ipch folders and any .sdf files
_____ /  6      Project compiles and executes properly in Visual Studio and on ranger

_____ / 10      Total
      

Last Modified: