exam2 - ELEG 025 - 4 Lab Assignment # 4 Closed Book: 2...

Info iconThis preview shows pages 1–2. 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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ELEG 025 - 4 Lab Assignment # 4 Closed Book: 2 Hours June 11, 2003 Name: _________________________ ID: __________________________ 1. Create a class Rectangle with integer attributes width and length with both defaulting to 1. It should also have member functions that calculate and return the perimeter and the area of a rectangle object. It should have a constructor member function that takes two integer parameters and construct a rectangle object out of them, and verify that they are larger than 0 but smaller than 100. Test your class in a simple program that creates an array of rectangle objects and then reads a set of width and length pairs and make rectangles out of each pair using the constructor. Use the perimeter and area functions to print the corresponding information about the various rectangle objects. 2. Write a program to carry out manipulation on sets. Create a class called set with two private members , the elements of the set and the size of the set. The elements should be an array of integers to hold an appropriate number of elements (e.g. 20), assumed to be positive integers. Provide a default constructor to (e....
View Full Document

This note was uploaded on 02/26/2010 for the course EECE 230 taught by Professor Samikaraki during the Fall '07 term at American University of Beirut.

Page1 / 2

exam2 - ELEG 025 - 4 Lab Assignment # 4 Closed Book: 2...

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

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