Introductory Project

The slides for Laboroatory 0 are here (or the pdf file) and some source code is linked to in the left-hand menu. Also available is a Introductory Project Manual.

In this lab, you will:

  1. Meet the laboratory instructor and some of the laboratory teaching assistants.
  2. Review the difference between pass-by-value and pass-by-reference.
  3. Get you logged onto the Linux server ecelinux.uwaterloo.ca .
  4. Give you a quick introduction to Unix shell commands.
  5. Create a "Hello world!" program on ecelinux.
  6. Create a project in Visual Studio.
  7. Get started with a simple Array class with three member functions:
    1. Array( int )
    2. int size() const
    3. void append( int )
  8. Create an executable file in the project and compile it.
  9. Discuss how to read compile-time error messages to fix your code.
  10. We will correct a weakness in the append function.
  11. We will implement three more functions:
    1. int capacity() const
    2. bool empty() const
    3. bool full() const
    4. void clear()
  12. We will then implement four statistical functions:
    1. int sum() const
    2. double average() const
    3. double variance() const
    4. double std_dev() const
  13. Deallocating memory with the destructor ~Array().
  14. Access entries of the array with operator[].
  15. Implement a swap function void swap( Array & ).
  16. Implement the copy constructor Array( Array const & ).
  17. Implement the assignment operator operator= for this Array class.
  18. Discuss move constructors and move assignment operators.
  19. Discuss why we need templates, how templates work, and update the class for templates.
  20. A quick review as to why pass-by-constant-reference is useful in C++.
  21. A discussion of testing your code and the testing environment we provide you.
  22. Creating and running your own test scripts.
  23. Copying everything back into ecelinux.uwaterloo.ca.
  24. A discussion on project submissions.
  25. A quick look at recursive functions in C++.