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