Sie sind auf Seite 1von 4

THE COUNCIL OF COMMUNITY COLLEGES OF JAMAICA

ASSOCIATE DEGREE COURSEWORK

SEMESTER 1 – SEPTEMBER 2010

PROGRAMME: MANAGEMENT OF INFORMATION SYSTEMS, HTM

COURSE NAME: COMPUTER PROGRAMMING II


CODE: CPRG2301

YEAR GROUP: TWO

DATE:

TIME:

DURATION:

EXAMINATION TYPE: COMMON COURSEWORK 1 – Individual assignment

DUE DATE:

INSTRUCTIONS:

Individual Assignment – Exception Handling (Weighting 10%)

This assignment will assess your understanding of operator overloading. Respond substantively to
all parts of the question.

Create a class Rational Number (fractions) with the following capabilities:

a. It should accept 2 private data members: denominator and numerator.


b. Mutators and Accessors. (3 marks)
c. Create a constructor that prevents a 0 denominator in a fraction, reduces or simplifies
fractions that are not in reduced form and avoids negative denominators. (4 marks)
d. Overload the addition, subtraction, multiplication and division operators for this class to
work with two objects. (12 marks)
e. Overload the relational and equality operators for this class. (6 marks)

(Total Marks – 25 marks)


THE COUNCIL OF COMMUNITY COLLEGES OF JAMAICA
ASSOCIATE DEGREE COURSEWORK

SEMESTER 1 – SEPTEMBER 2010

PROGRAMME: MANAGEMENT OF INFORMATION SYSTEMS

COURSE NAME: COMPUTER PROGRAMMING II


CODE: CPRG2301

YEAR GROUP: ONE

DATE:

TIME:

DURATION:

EXAMINATION TYPE: COMMON COURSEWORK 2 – Individual assignment

DUE DATE:

INSTRUCTIONS:
Computer Programming II – C++

Individual Assignment – Exception Handling (Weighting 10%)


This assignment will assess your understanding of exception handling. Respond substantively to
all four parts.

1. A program contains the statement

throw;

Where would you normally expect to find such a statement? What if that statement
appeared in a different part of the program? (5 marks)

2. Compare and contrast exception handling with the various other error-processing schemes.
(5 marks)
3. Write a program that demonstrates several exception types being caught with the
catch(...) exception handler. (10 marks)
4. Write a program that illustrates rethrowing an exception. ( 10 marks)

Das könnte Ihnen auch gefallen