Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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++:

image text in transcribed

///////// 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions