944,085 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1246
  • C++ RSS
Oct 17th, 2005
0

Help!!!!!!

Expand Post »
I am very new to this and i really need some help :cry:

Objective: Understanding of static data types (arrays), traversals, searching and insertion into arrays.

Description: In this assignment, you will create a game similar to that of 'Wheel of Fortune'. While the show itself lacks any real worth (I heard a comedian say the contestants were fascinated by shiny objects), programming WoF is non-trivial. It relies heavily on arrays, as you will see!

Background: You should know how to declare arrays, and how to use a loop to traverse the array. You'll need that for sure when printing the array! Also, remember that you can initialize arrays in the following manner:

char phrase [] = {'b', 'o', 'b', ' ', 'w', 'a', 's', ' ', 'h', 'e', 'r', 'e'};

and then count the number of characters (including spaces) that are in the array.

Most of the functions that you write will take in one or more arrays, and their sizes. This way you can traverse through the array easily.

The basic implementation is to have your 'phrase' array, and an array of booleans, list, of the same size. When the user guesses a character, traverse both arrays. If the character the users guessed matches the phrase array at slot s, the list[s] = true. This way, when you print out your phrase, you will know whether or not that slot should be printed. (Another way would be to keep track of each letter guessed, and have a function that returns true or false as to whether or not that character should be printed). There are several ways to implement this program, so just pick something that makes sense and go with it!

Requirements: This is one of the few times you will be allowed to hard-code your program. Make sure you declare your arrays in the main function, and pass them to functions as needed. I don't want to see any function over 15 lines of code! This will force you to think about modularity. And don't think that you can cram all of your code on one line to get under the 15 lines... we won't fall for it!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
shantise2003 is offline Offline
1 posts
since Oct 2005
Oct 17th, 2005
0

Re: Help!!!!!!

Just guessing, but are you using C/C++ for this? What kind of help do you need? What's not making sense? I don't mind helping with homework as long as it looks like you've made an attempt at it first.

Wally
www.power-coder.net
Reputation Points: 10
Solved Threads: 0
Light Poster
wally_lawless is offline Offline
26 posts
since Oct 2005
Oct 17th, 2005
0

Re: Help!!!!!!

Quote originally posted by shantise2003 ...
I am very new to this and i really need some help :cry:
Please read the Announcement.

Post an attempt.
Team Colleague
Reputation Points: 2780
Solved Threads: 312
long time no c
Dave Sinkula is offline Offline
4,790 posts
since Apr 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Please Help Me
Next Thread in C++ Forum Timeline: C++





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC