Question: C++: ///////// thinker.h class thinking_cap { public: void slots(char new_green[ ], char new_red[ ]); void push_green( ) const; void push_red( ) const; private: char green_string[50];
C++:
![C++: ///////// thinker.h class thinking_cap { public: void slots(char new_green[ ], char](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f2c7db3780a_90666f2c7daceba9.jpg)
///////// thinker.h
class thinking_cap
{
public:
void slots(char new_green[ ], char new_red[ ]);
void push_green( ) const;
void push_red( ) const;
private:
char green_string[50];
char red_string[50];
};
//////// thinker.cpp
#include
#include
#include "thinker.h"
int main( )
{
thinking_cap student;
thinking_cap fan;
student.slots( "Hello", "Goodbye");
fan.slots( "Go Cougars!", "Boo!");
student.push_green( );
fan.push_green( );
student.push_red( );
return 0;
}
void thinking_cap::slots(char new_green[ ], char new_red[ ])
{
assert(strlen(new_green)
assert(strlen(new_red)
strcpy(green_string, new_green);
strcpy(red_string, new_red);
}
void thinking_cap::push_green
{
cout
}
void thinking_cap::push_red
{
cout
}
In class, the following two files are used to describe an introductory level object oriented program in C++. However, the files may not be complete. Implement the code as a header file and an implementation file and modify the code, if needed to make it operate as advertised
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
