This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: H62SED; Software Eng. Design P Sewell Oct 2007 2007/2008 exam paper solutions General Comment Please note that this is a completely open book exam and moreover the students have complete electronic access to all the example programs used to present the course. Therefore, please take into consideration that successful completion of this exam does not involve large quantities of typing, rather judicious “cut, paste and modification”. Of course the test is knowing what to cut and paste! The tasks are graded from that required for a basic pass (task 1) through to tasks 5 and 6 which are there to provide scope for 1 st class students to do their thing! It is not intended that equal marks are awarded for equal “volumes” of code. I provide a full worked solution to all tasks and one for just task 1 which corresponds to a basic pass. Please note that there are a few things in the solution that are not strictly optimal – this reflects the level of the course – not the lecturer’s programming ability! In the marking scheme x+y% for functions means x% for a correct interface and y% for a correct implementation. Just x% requires both correct interface and implementation. Clearly, there are different equally valid ways of implementing many of the functions and I will use my judgement to deal with any variations within the spirit of the scheme below. Task1 (40%) Correct use of private 5% point(float xx=0,float yy=0,float zz=0); 2+3% and 5% for defaults point(const point &p); 2+3% ~point(); 2+3% point& operator=(const point& p); 5+5% float get_x/y/z() const; 5% Task 2 (10%) float distance(const point &p0, const point &p1) 5+5% (must use const reference arguments) Task 3 (10%) friend istream& operator>>(istream& in,point &p); friend ostream& operator<<(ostream& out,point &p); together 5+5% Task 4 (10%) point* point::midpoint(const point& p) const 2+8% Task 5 (20%) number_of_vertices and vertices private 2,5% shape(int n=0, point** p=NULL); 2,5% and 2,5% for defaults shape(const shape& s); 2,5% shape& operator=(const shape& s); 2,5% virtual ~shape(); 2,5% void report_vertices(); 5% Task 6 (10%) virtual ~shape(); 2,5% if virtual class tetrahedron:public shape 2,5% class cube:public shape 2,5% virtual void print_my_type(); 2,5% // Basic pass solution (task1)...
View
Full
Document
This note was uploaded on 08/14/2011 for the course ELECTRONIC H62SED taught by Professor Professorp during the Spring '09 term at Uni. Nottingham.
 Spring '09
 ProfessorP

Click to edit the document details