08-09 exam_soln - H62SED; Software Eng. Design P Sewell Oct...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: H62SED; Software Eng. Design P Sewell Oct 2008 2008/2009 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 6 and 7 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 lecturers 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% polynomial(int n, float *c=0); 2+3% and 5% for default or alternative constructor polynomial(const polynomial &p); 2+3% ~polynomial(); 2+3% polynomial& operator=(const polynomial& p); 5+5% int get_number_coefficients() const; and float get_coefficient(int i) const 5% Task 2 (10%) float evaluate(float x) const; 5+5% Task 3 (10%) complex_numbers* factorise(const polynomial&p); 10% (must use const reference arguments) Task 4 (10%) polynomial operator+(const polynomial &c) const; and polynomial& operator+=(const polynomial &c); 5+5% Task 5 (10%) polynomial operator+(float f) const; 5+5% Task 6 (10%) polynomial operator+(float f,const polynomial& p) 5% for non member and 5% if works Task 7 (10%) virtual float evaluate(float x) const =0; 2.5% virtual ~maths_function(){}; 2.5% class polynomial:public maths_function 2.5% virtual float evaluate(float x) const; 2.5% //--------------------------------------------------------------------------- Basic pass solution (task1) //--------------------------------------------------------------------------- class polynomial { private: int number_coefficients; float* coefs; public: int get_number_coefficients(){return(number_coefficients);} float get_coefficient(int i);...
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.

Page1 / 11

08-09 exam_soln - H62SED; Software Eng. Design P Sewell Oct...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online