Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need code in c + + Given an ARRAY of BOOL where the TRUE indexes 1 indicate a PRIZE. ~ bool room [ 6

i need code in c++ Given an ARRAY of BOOL where the TRUE indexes 1 indicate a PRIZE. ~ bool room[6][6]={{1,0,0,0,0,1},{0,1,0,0,0,1},{0,0,1,0,0,0},{0,1,0,0,0,1},{0,0,0,1,0,0},{1,0,0,1,0,0}}; Create a game with the following rules: User is given FIVE turns to find as many prizes as they can. Users select the row and column (the same way we programmed TrapFinder) to create the search index. When a prize is found set the bool value to 0(FALSE) to indicate no prize in the index and increase a found counter. After every selection display to user a String message indicating "Turn 1: you selected index [row],[column]. Prize found is false.. Total prizes found: 0." "Turn 2: you selected index [row],[column]. Prize found is true... Total prizes found: 1." "Turn 3: you selected index [row],[column]. Prize found is true... Total prizes found: 2." "Turn 4: you selected index [row],[column]. Prize found is false.. Total prizes found: 2." "Turn 5: you selected index [row],[column]. Prize found is true... Total prizes found: 3." Use a STACK to store the user selections as a history. When the five turns are complete display how many prizes were found and give a rating such as: 5 found ~ excellent 4 found ~ super 3 found ~ good 2 found ~ sad 1 found ~ ok 0 found ~ try again Then print the search history back to the USER represented in the same order it was selected. SUBMIT YOUR CODE IN A JAVA file, TXT file. NO WORD DOCUMENTS or PDF's. THEY WILL BE PENALIZED. GRADING RULES: YOU MUST USE the ARRAY AND the STACK AS REQUIRED - instructed. ARRAY stores BOOL values 0,1- must flip to 1 when found prize (as explained above). STACK stores STRING of selected index, prize T/F and Total found (as explained above). YOU MUST use a function to ask for user input. You need to use a function to display the results. And you MUST use a separate function to display HISTORY from the STACK. You must use a loop in your program to cycle through any STACKS needed. PAY ATTENTION TO DETAILS and FOLLOW ALL INSTRUCTIONS ABOVE DO NOT COPY, if everyone turns in the same implementation that is cheating. BE CAREFUL and DO NOT SHARE YOUR CODE you will get a ZERO ~ F. Better to try than to fail. Partial credit is given to code. USE COMMENTS! If I do not understand it I can not give partial credit. YOU HAVE THE ENTIRE THREE HOURS to turn in your solution.

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

Advances In Databases And Information Systems Second East European Symposium Adbis 98 Poznan Poland September 1998 Proceedings Lncs 1475

Authors: Witold Litwin ,Tadeusz Morzy ,Gottfried Vossen

1st Edition

3540649247, 978-3540649243

More Books

Students also viewed these Databases questions

Question

4. Support and enliven your speech with effective research

Answered: 1 week ago

Question

3. Choose an appropriate topic and develop it

Answered: 1 week ago