Stringed Instruments, Inheritance Demo
StringedInstrument.h
1 #pragma once
2 #include "cmpslib.h"
3 #include "Instrument.h"
4 
10 {
11 protected:
13 short int string_type;
14 string ToMembersXML();
15 
16 
17 public:
18 static const int nylon =0;
19 static const int steel =1;
20 static const int rubber =2;
21 
22 string ToString();
23 string ToXML();
24 
26 StringedInstrument(string brand="", string model="", double cost=0, double retail_price=0
27  ,short int string_type=StringedInstrument::nylon,string standard_tuning="");
28 
29 string GetStandardTuning();
30 int GetStringType();
31 string GetStringTypeName();
32 void SetStandardTuning(string);
33 void SetStringType(int);
34 
35 };
36 
37 
38 
string brand
Brand Name of Product.
Definition: Instrument.h:12
string GetStandardTuning()
Accessor function.
Definition: StringedInstrument.cpp:50
Definition: StringedInstrument.h:9
void SetStringType(int)
Mutator function.
Definition: StringedInstrument.cpp:65
static const int nylon
a constant value for the string_type member
Definition: StringedInstrument.h:18
double cost
Wholesale Price.
Definition: Instrument.h:14
string model
Model Name of Product.
Definition: Instrument.h:13
void SetStandardTuning(string)
Mutator function.
Definition: StringedInstrument.cpp:64
int GetStringType()
Accessor function.
Definition: StringedInstrument.cpp:51
double retail_price
Retail Price.
Definition: Instrument.h:15
string GetStringTypeName()
return a string representing the string type instead of the int value
Definition: StringedInstrument.cpp:52
static const int steel
a constant value for the string_type member
Definition: StringedInstrument.h:19
string ToMembersXML()
return a string represention of all the data in the class serialized as XML without the outer class t...
Definition: StringedInstrument.cpp:5
string ToString()
Returns a string representation of the data in the class.
Definition: StringedInstrument.cpp:26
StringedInstrument(string brand="", string model="", double cost=0, double retail_price=0, short int string_type=StringedInstrument::nylon, string standard_tuning="")
Definition: StringedInstrument.cpp:16
short int string_type
An integer value that represents the material type of the strings.
Definition: StringedInstrument.h:13
string ToXML()
return a string represention of the entire class serialized as XML
Definition: StringedInstrument.cpp:36
string standard_tuning
A string representation of the default note for each string.
Definition: StringedInstrument.h:12
Definition: Instrument.h:9
static const int rubber
a constant value for the string_type member
Definition: StringedInstrument.h:20