159.234辅导讲解、辅导C/C++语言程序、辅导C/C++设计、C/C++编程辅导
- 首页 >> C/C++编程159.234-2018 Semester 2
Assignment 2 part 2
Deadline: Anytime before Sunday 7 October 2018 time due 23:00
Evaluation: 10 marks – which is 5% of your final grade
Late Submission: 5% per hour (or fraction of hour) it is late
Teams The assignment can be done individually or in pairs (of at most 2
students)
Purpose: Practice with C++ class templates and dynamic memory
Problem to solve:
In this assignment, you will design and implement a class template that represents a simplified version of an STL vector.
You should write the implementation of all member functions of the class template template<typename T> class Vec as specified in the a2p2scheleton.h file (on
Stream). Read the file a2p2scheleton very careful.
Notes: Do not include any main() function in your vec.h file.
For this assignment you should not use any STL container or STL algorithm and
you should not use the C++ -smart pointers in your code.
Hand-in: Submit your completed vec.h?file electronically using STREAM.
Here is an example of how the type you define should behave. For the main function from the file test_vec.cpp (on Stream) the following output is produced:
159.234-2018 Semester 2
Please be aware we will perform more tests in order to check that your type implements all features required as mentioned in the file a2p2scheleton.h.
Miscellaneous:
1. The program must be your own work. Please be aware that you might be asked to
explain to your lecturer how your program works. If you cannot explain it, then it is not yours and you will get 0 marks for that assignment. Attributing someone else's work as your own is plagiarism, and it is a violation of Massey University policy. We might file an official complaint against any student who we believe has committed plagiarism.
2. Marks will be allocated for: correctness, completeness, use of C++ constructs
presented in class/tutorials, simple and clear solution, good documentation, and
structured output display (on screen).
3. Only const global variables are allowed.
4. Using goto, non-constant global variables or C-like I/O constructs (i.e printf,fprintf, scanf, FILE*, etc) or STL tools (vector, lists, algorithms, etc.--not presented in class) is not allowed and it will be penalised.
5. Programs that do not run or do not compile in the (Albany) labs, using gcc(SciTe),get 0 marks.
6. Suspicious similar solutions will all get 0 marks-see also point 1 above.
7.Write YOUR ID NUMBER(S), and YOUR FAMILY NAME(S) first, assignment
number, what the program does at the beginning of the file you send electronically.
8. When working in pair, send one solution file per team.
9. The assignment will be previewed on Thursday lecture before the assignment is due.If you have any questions about this assignment, please ask the lecturer before its due time!