Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

COMSC 140 OBJECT ORIENTED C+++ RED-YELLOW-GREEN GAME Concept: Classes (60 POINTS) Use a use Linux with a GCC compiler, or an IDE such as Eclipse,

image text in transcribed

COMSC 140 OBJECT ORIENTED C+++ RED-YELLOW-GREEN GAME Concept: Classes (60 POINTS) Use a use Linux with a GCC compiler, or an IDE such as Eclipse, XCode, or Code Blocks to develop this program. Eclipse and Code Blocks are on the Virtual Machine in the CS lab. Use at least one user defined class in your program. Write a program to have the computer generate a digit between 100 and 999. Then the user will try to guess the number. Every time a guess is made, the computer responds with the number of red, yellow, and green digits in the guess. A guess digit is green if the guess digit and the corresponding digit are the same. A guess digit is red if it does not correspond to any of the digits. A yellow guess is if it is a correct digit but not in the correct place. The edge case for verifying this program is for example: the computer generates 212 and the user enters 229.4 Suppose the computer's number is 123. Your output may look as follows: Please enter a guess? 422 You have: 2 red 1 0 yellow Enter the next guess? 459 You have: 3 red 0 Oyellow Enter the next guess?- 122 You have: 1 red 2 green O yellow Enter the next guess?- 1234 CONGRATULATIONS, YOU ARE CORRECT!!!!!!!!!!!!!! green green

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

Students also viewed these Databases questions