CS 302 Data Structures C++ Interlude 1 C++ Classes

CS 302 Data Structures C++ Interlude 1 C++ Classes
1 / 1
CS 302 Data Structures C++ Interlude 1 C++ Classes - slide 1 of 13 CS 302 Data Structures C++ Interlude 1 C++ Classes - slide 2 of 13 CS 302 Data Structures C++ Interlude 1 C++ Classes - slide 3 of 13 CS 302 Data Structures C++ Interlude 1 C++ Classes - slide 4 of 13 CS 302 Data Structures C++ Interlude 1 C++ Classes - slide 5 of 13 CS 302 Data Structures C++ Interlude 1 C++ Classes - slide 6 of 13 CS 302 Data Structures C++ Interlude 1 C++ Classes - slide 7 of 13 CS 302 Data Structures C++ Interlude 1 C++ Classes - slide 8 of 13 CS 302 Data Structures C++ Interlude 1 C++ Classes - slide 9 of 13 CS 302 Data Structures C++ Interlude 1 C++ Classes - slide 10 of 13 CS 302 Data Structures C++ Interlude 1 C++ Classes - slide 11 of 13 CS 302 Data Structures C++ Interlude 1 C++ Classes - slide 12 of 13 CS 302 Data Structures C++ Interlude 1 C++ Classes - slide 13 of 13
CS 302 Data Structures C Interlude 1 C Classes Classes file PlainBox.h ifndef PLAINBOX define PLAINBOX Set the type of data stored in the box typedef double ItemType; Declaration for the class PlainBox class PlainBox

Related Topics

Download this presentation From Below

"CS 302 Data Structures C++ Interlude 1 C++ Classes" is the property of its rightful owner. Permission is granted to download and print the materials on this website for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.

Presentation Transcript

01
CS 302 Data Structures C++ Interlude 1
C++ Classes<br>
02
Classes<br>
03
/** @file PlainBox.h */
#ifndef _PLAIN_BOX
#define _PLAIN_BOX
// Set the type of data stored in the box
typedef double ItemType;

// Declaration for the class PlainBox
class PlainBox
{
private:
// Data field
ItemType item;

public:
// Default constructor
PlainBox ();
// Parameterized constructor
PlainBox (const ItemType & theItem);
// Method to change the value of the data field
void setItem (const ItemType & theItem);
// Method to get the value of the data field
ItemType getItem () const;
}; // end PlainBox
#endif<br>