//Chapter 6 Debug 1 #include #include class Auto { private: int autoId; char mechanicName[20]; double fee; public: Auto(int id = 999, char name[], double amt = 25.00); void showAuto(); }; Auto(int id, char name[], double amt) { autoId = id; strcpy(mechanicName, name); fee = amt; } void showAuto() { cout<<"Auto #"< _________________________________________
//Debug 6-2 #include #include class BirthdayCake { private: int orderNumber; char cakeFlavor[20]; char frostingFlavor[20]; int numCandles; BirthdayCake(int num, char cake[]="white", char frost[] = "vanilla", int numCandles = 1); void displayBirthdayCake(); }; BirthdayCake::BirthdayCake(int num, char cake[] = "white", char frost[] = "vanilla", int candles) { orderNumber = num; cakeFlavor =cake; frostingFlavor =frost; numCandles = candles; } void BirthdayCake::displayBirthdayCake() { cout<<"Order #"< ________________________________________
//Debug 6-3 #include #include class ClubMember { private: static int count; char name[20]; public: ClubMember(); ~ClubMember(); }; int ClubMember::count = 0; ClubMember::ClubMember(char name) { ++count; strcpy(name,name); cout<<"ClubMember #"< // Debug 6-4 #include #include class Dress { private: char material[20]; int size; char style[10]; double price; public: Dress(char mtrl[] = "cotton",char stl[] = "daytime"); void displayDress(); }; Dress::Dress(char mtrl[], int sz, char stl[]) { strcpy(material,mtrl); sz = size; strcpy(style,stl); price = 29.99; if(strcmp(material,"silk") == 0) price += 20.00; if(strcmp(style, "evening")==0) price += 40.00; } void Dress::displayDress() { cout<<"A size "<