Question: Problem 2: Write a C++ program and algorithm for a class inheritance game where a kitten with random position in the gameboard is to be

 Problem 2: Write a C++ program and algorithm for a class

Problem 2: Write a C++ program and algorithm for a class inheritance game where a kitten with random position in the gameboard is to be caught by its mother cat whose initial position is center to board and speed to particular direction a little higher than the kitten. The class member functions include a draw function where the mother cat stays at the middle. The direction is measured by the input function when say press '4' means LEFT, 'G' means RIGHT, '8' means UP, '2' means DOWN and 's' means STOP. Use a score as the mother cat catches her kitten. Change the coordinates of the kitten and mother cat to zero, if they touch the wall. (Marks 30) Note: Use #include for console I/O and functions kbhit() which returns true if key board is pressed and getch() which returns ASCII value of the key pressed. Problem 2: Write a C++ program and algorithm for a class inheritance game where a kitten with random position in the gameboard is to be caught by its mother cat whose initial position is center to board and speed to particular direction a little higher than the kitten. The class member functions include a draw function where the mother cat stays at the middle. The direction is measured by the input function when say press '4' means LEFT, 'G' means RIGHT, '8' means UP, '2' means DOWN and 's' means STOP. Use a score as the mother cat catches her kitten. Change the coordinates of the kitten and mother cat to zero, if they touch the wall. (Marks 30) Note: Use #include for console I/O and functions kbhit() which returns true if key board is pressed and getch() which returns ASCII value of the key pressed

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!