[Solved] SOLVED:Scrambled 1 Intro to Programming in C Assignment 3 – ScrambledUp

30 $

File Name: SOLVED:Scrambled_1_Intro_to_Programming_in_C_Assignment_3_–_ScrambledUp.zip
File Size: 687.66 KB

SKU: [Solved] SOLVED:Scrambled 1 Intro to Programming in C Assignment 3 – ScrambledUp Category: Tag:

Or Upload Your Assignment Here:


Assignment purpose: User defined functions, character arrays, c style string member functionsWrite an interactive program that will allow a user to play the game ScrambledUp. You will need to: Declare and use four character arrays:o one for the “solution/answer” from the fileo one for the “scrambled word” from the fileo one for all of the “partial solution” wordo one to hold the users “word to guess” Declare additional variables as needed Preload the arrayso “solution/answer” array – start with an empty string. Read the first word from the file, “scrambledwords.txt”, and store it in the solution/answer array.o “scrambled word” array – start with an empty string Read the second word from the file and store it in the scrambled word arrayo “partial solution” array should be adjusted to the correct length (that is the same size as the word read from the file but consists only of * (asterisks) in the beginningo “word to guess” array should be empty – used to hold the attempt by the user to input the answerHOW TO PLAY THE GAME Allow the user to select letters one character at a time for proper placement in the word. At every stage of the game, the user should be able to view the scrambled word and the current state of the “partial solution”. If a letter is added and the word is not guessed correctly, the number of remaining guesses is decreased. Each time the user is asked for a letter, the array containing the “partial solution” word is displayed with * replacing any letters that have not yet been guessed. The “scrambled word” word is also displayed each time the user is asked for a letter. The user is allowed up to 3 incorrect guesses. The game is over when the word is guessed correctly or the three incorrect guesses are used up. If the player guesses the word correctly, the player is notified that they have won and the correct word is displayed. If the player does not get the correct word and the guesses are all used, the player is notified that they have lost and the correct word is displayed. When the game is over, the user should be allowed to play again without having to execute the program again. ( The player will play again with the next set of words in the file)COP2220 –Scrambled 2Helpful Hints A word is guessed correctly when all of the characters in “word to guess” match the “solution/answer” Only letters from a to z and from A to Z will be used. Remember that the C language is case sensitive. For this program a = = A. In order to do this you will need to convert all letters to lowercase either before or during the letter matching process. You will need to have a preprocessor directive to include the library file ctype.h in order to access these functions.o char tolower(char x) – takes the original letter and returns the lowercase equivalento char toupper(char x) – takes the original letter and returns the uppercase equivalento Do NOT assume all input words from the file have lower case letters or that the user will stick to one caseOther Requirements You must have meaningful variable and function names. You must use consistent and proper indentation You must use sufficient comments that tell a programmer what is happening in the program You must have at least 8 user-defined functions (not the main function) with meaningful names that perform the specified tasks:o A function that returns the letter that the user has guessed.o A function that determines if the player would like to play again.o A function that tells the user if they won or losto A function that sets all of the characters in a word to the same case (upper or lower).o A function that displays the instructions on how to play the game.o A function that locates and places the selected letter where it belongs in the partial solution array.o A function that plays one entire game (not the main function)o One additional function of your own choice. You must use function prototypes placed before the main function and all function definitions must follow the main function. All function prototypes and definitions must have a comment describing what the function does. If the function has more than 5 lines of code there should be additional comments.What to turn in when: Outline of program code algorithm as a comment on your code Electronic submission of you source code (scrambleUp.c) submitted under the Assignment before the UNIT deadlineCOP2220 –Scrambled 3Sample Output :Welcome to the Wheel of Scramble gameYou will see the word in scrambled form.Pick a letter and I will show you where the letter belongs in the word.. . . Next you guess the word . . .If you can’t guess it, don’t worry.You will have three guesses to figure it out!~~~~~~~~~~~~ PICK A LETTER ~~~~~~~~~~~~~Here is the scrambled word:swardpsoHere are the letters you have so far:********WHAT LETTER WOULD YOU LIKE TO PLACE? s———— GUESS THE WORD ————-Here is the scrambled word:swardpsoHere are the letters you have so far:**ss****GUESS THE WORD: no________ no is not the word________ that was guess number 1~~~~~~~~~~~~ PICK A LETTER ~~~~~~~~~~~~~Here is the scrambled word:swardpsoHere are the letters you have so far:COP2220 –Scrambled 4**ss****WHAT LETTER WOULD YOU LIKE TO PLACE? p———— GUESS THE WORD ————-Here is the scrambled word:swardpsoHere are the letters you have so far:p*ss****GUESS THE WORD: passwordThe word was passwordYay — you won 🙂Would you like to play again(Y or N)? Y~~~~~~~~~~~~ PICK A LETTER ~~~~~~~~~~~~~Here is the scrambled word:spanhpsieHere are the letters you have so far:*********WHAT LETTER WOULD YOU LIKE TO PLACE? p———— GUESS THE WORD ————-Here is the scrambled word:spanhpsieHere are the letters you have so far:**pp*****GUESS THE WORD: noCOP2220 –Scrambled 5________ no is not the word________ that was guess number 1~~~~~~~~~~~~ PICK A LETTER ~~~~~~~~~~~~~Here is the scrambled word:spanhpsieHere are the letters you have so far:**pp*****WHAT LETTER WOULD YOU LIKE TO PLACE? n———— GUESS THE WORD ————-Here is the scrambled word:spanhpsieHere are the letters you have so far:**pp*n***GUESS THE WORD: no________ no is not the word________ that was guess number 2~~~~~~~~~~~~ PICK A LETTER ~~~~~~~~~~~~~Here is the scrambled word:spanhpsieHere are the letters you have so far:**pp*n***WHAT LETTER WOULD YOU LIKE TO PLACE? s———— GUESS THE WORD ————-COP2220 –Scrambled 6Here is the scrambled word:spanhpsieHere are the letters you have so far:**pp*n*ssGUESS THE WORD: hippaness________ hippaness is not the word________ that was guess number 3The word was happinessSorry you did not win this roundWould you like to play again(Y or N)? NPress any key to continue . . .

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] SOLVED:Scrambled 1 Intro to Programming in C Assignment 3 – ScrambledUp
30 $