Stringed Instruments, Inheritance Demo
ElectricGuitar.h
1 #pragma once
2 #include "cmpslib.h"
3 #include "Guitar.h"
4 #include "Electric.h"
5 
6 
12 class ElectricGuitar : public Guitar, public Electric
13 {
14 protected:
15 
16 string ToMembersXML();
17 
18 
19 public:
20 string ToXML();
21 string ToString();
22 
25 ElectricGuitar(string brand="", string model="", double cost=0, double retail_price=0
26  ,int string_type = StringedInstrument::steel,string bridge_pickup="",string center_pickup="",string neck_pickup="");
27 
28 };
29 
30 
31 
ElectricGuitar(string brand="", string model="", double cost=0, double retail_price=0, int string_type=StringedInstrument::steel, string bridge_pickup="", string center_pickup="", string neck_pickup="")
Definition: ElectricGuitar.cpp:6
string neck_pickup
description of the neck pickup
Definition: Electric.h:15
string ToString()
Returns a string representation of the data in the class.
Definition: ElectricGuitar.cpp:40
string brand
Brand Name of Product.
Definition: Instrument.h:12
string bridge_pickup
description of the bridge pickup
Definition: Electric.h:13
double cost
Wholesale Price.
Definition: Instrument.h:14
string model
Model Name of Product.
Definition: Instrument.h:13
Definition: ElectricGuitar.h:12
double retail_price
Retail Price.
Definition: Instrument.h:15
string ToMembersXML()
Returns an XML string of the data in the class wihout the outer tag with the classname.
Definition: ElectricGuitar.cpp:21
Definition: Electric.h:10
Definition: Guitar.h:11
static const int steel
a constant value for the string_type member
Definition: StringedInstrument.h:19
string center_pickup
description of the center pickup
Definition: Electric.h:14
string ToXML()
return a string represention of all the data in the class serialized as XML
Definition: ElectricGuitar.cpp:31
short int string_type
An integer value that represents the material type of the strings.
Definition: StringedInstrument.h:13