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++:
///////// 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 advertisedStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started