Lab 1: C++ Program

You can compile C++ using many different IDEs(Integrated Development Environments) such as eclipse, microsoft Visual Studio. These IDEs permit you to save your code within the application.
There are websites that also allow you to compile simple C++ programs, BUT you cannot save your code there. You can use:
http://cpp.sh
instead of eclipse. Make sure you add the line:

using namespace std;
after the lines that start with
#include
Also, remove the "std::" at the start of several of the lines.
You can then code as we do in the class room.

Within main,

  1. declare an integer named "some_integer"
       int some_integer;
  2. write an assignment statement to assign some the value of 40
       some_integer = 40;
  3. output "some_integer" followed by a new line
       cout << some_integer << endl;
  4. output your name followed by a new line
  5. The line that begins with int, declares a variable with the name of some_integer and enough space to hold a small integer.
    The next line of code with an = sign in it, puts 40 in the space in memory named some_integer.
    When you send something to the cout command and do not have quotes around it, C++ looks for a variable of that name and displays whatever is in memory.

Now submit your work to the drop box:
  1. Open file explorer
  2. Navigate to your Eclipse Work Space
    If you've forgotten where it is, Select "file", "Properties" and view the location
  3. Open the folder with the name for the lab
  4. Open the folde "src"
  5. Drag your cpp code to the D2L dropbox

To submit your work that you do in cpp.sh,

  1. copy your code to Notepad
  2. Select File, Save as
  3. Where it lists the extenstion (txt), use the drop down and select all files
  4. For the file name, type it what you want to save it as AND then ".cpp"
  5. Open File Explorer
  6. Navigate to the folder where the .cpp file was saved
  7. Drag the .cpp file into the D2L dropbox