lab1 - CSS 342: Mathematical Principles of Computing Lab 1:...

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

View Full Document Right Arrow Icon
CSS 342: Mathematical Principles of Computing Lab 1: Objects and Classes Professor: Munehiro Fukuda Assigned: See Our Syllabus Purpose This laboratory work exercises how to construct abstract data types through implementing a Distance class in C++. It also reviews type conversions for classes, operator overloading, and input/output including the friend concept. Overview of Distance Number Class A Distance class presents a distance in feet and inches. For instance, Distance d(5, 3) means 5 feet 3 inches. A Distance class you will design should have the following features. Type conversion The class must define a constructor that receives various primitive types such as int , float and double , converts those arguments into int , and initializes its private data: feet and inch with them. Make sure if the g++ compiler automatically converts them to int. If not, your constructor must take care of the type conversion. Member functions Provide the following two member functions: getFeet returns the feet data member of this distance number. getInch
Background image of page 1

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

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

This document was uploaded on 12/20/2009.

Page1 / 3

lab1 - CSS 342: Mathematical Principles of Computing Lab 1:...

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