how would i put this assignment into code for c++

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

how would i put this assignment into code for c++

Post by answerhappygod »

how would i put this assignment into code for c++
How Would I Put This Assignment Into Code For C 1
How Would I Put This Assignment Into Code For C 1 (89.43 KiB) Viewed 35 times
How Would I Put This Assignment Into Code For C 2
How Would I Put This Assignment Into Code For C 2 (108.53 KiB) Viewed 35 times
How Would I Put This Assignment Into Code For C 3
How Would I Put This Assignment Into Code For C 3 (84.07 KiB) Viewed 35 times
How Would I Put This Assignment Into Code For C 4
How Would I Put This Assignment Into Code For C 4 (117.52 KiB) Viewed 35 times
How Would I Put This Assignment Into Code For C 5
How Would I Put This Assignment Into Code For C 5 (57.06 KiB) Viewed 35 times
How Would I Put This Assignment Into Code For C 6
How Would I Put This Assignment Into Code For C 6 (19.01 KiB) Viewed 35 times
How Would I Put This Assignment Into Code For C 7
How Would I Put This Assignment Into Code For C 7 (39.24 KiB) Viewed 35 times
How Would I Put This Assignment Into Code For C 8
How Would I Put This Assignment Into Code For C 8 (15.27 KiB) Viewed 35 times
1. Copy the C source code file from Assignment 3 and rename it for Assignment 4 2. After the #include preprocessor commands add the following macros to create constants for the program a. NAME with the value of 20 ; used for the player's name string length b. WORDS with the value of 100 ; this is the maximum number of words found on a Boggle board c. LENGTH with the value of 17 ; this is the maximum number of characters of a valid Boggle word d. MAX with the value of 10 ; this will be used temporally to control the number of entries a player can enter 3. BEFORE ALL function prototypes define a structure Player with the following structure members a. One-dimensional character array (i.e. name); size is 20 (i.e. NAME) b. Two-dimensional character array (i.e. words); size is 100 rows, 17 columns (i.e. WORDS and LENGTH) c. Integer to store player's score (i.e. score) d. Integer to store player's number of words (i.e. count) 4. Write the function declaration or prototype for function playGame 5. Write the function declaration or prototype for function displayWordsFound
Update the main function to do the following a. At the beginning of the main function, BEFORE calls to function memset, declare a variable of data type struct Player (i.e. I used my first name, karin; use whatever variable name you choose) b. Comment out or delete the three following functions calls a. displayDice b. clearScreen c. displayBoard c. AFTER function call createBoard, call function playGame passing as arguments a. The address of the struct Player variable (i.e. karin) b. 2d array board 7. Write function playGame to do the following a. Return type void b. Parameter list includes i. Pointer of data type struct Player (i.e. karin) ii. Two-dimensional array (i.e. board), data type character, size: 4 rows, 4 columns (i.e. use the constants) c. Declare the following local variables i. Data type integer (i.e. play) initialized to constant TRUE; this will control the game play ii. Data type integer (i.e. idx) initialized to zero ( 0); this will be used to reference the struct Player's structure member two-dimensional array words d. Write a printf statement to prompt the user to enter their name e. Write a scanf statement to store the user's input in struct Player's structure member name f. Initialize struct Player's structure member count to zero (0) g. Initialize struct Player's structure member score to zero (0) h. Call function clearScreen i. Write a printf statement to present to the user their name and "let's play Boggle" i. Loop while TRUE
i. Call function displayBoard; pass as an argument the two-dimensional array board received as a parameter to this function ii. Write a printf statement to prompt the user to enter a word found followed by the Enter key iii. Write a scanf statement to store the user's input in struct Player's structure member words array at the index of local variable idx iv. Increment the struct Player's structure member count by one (1) 4 \begin{tabular}{|r|r|} \hline & v. Increment the local variable idx by one (1) \\ vi. Write a decision-making statement to determine if the \\ struct Player's structure member count is greater \\ than or equal to the constant MAX; if true, break out \\ of the loop \\ k. Call function displayFound Words passing as an argument \\ the parameter of data type struct Player (i.e. karin) \\ 8. Write function displayWordsFound to do the following a. Return type void b. Parameter list includes i. Pointer of data type struct Player (i.e. karin) \\ c. Declare the following local variables \end{tabular}
i. Data type integer (i.e. w); used as a loop control variable d. Write a printf statement to identify the output as "Words found" e. Loop through the struct Player's structure member words array i. Write a printf statement to output the character string stored at the current location in the array words
5 \begin{tabular}{|l|l|l|} \hline & name and clicks the Enter key & output in the command prompt should look similar Figure 3 playGame function, "let's play Boggle" and Figure 4 displayBoard function output and Figure 5 playGame function player prompt to enter word \\ \hline Test Case 5 & User enters a word and clicks the Enter key & The output in the command prompt should look similar Figure 6 playGame function output for each iteration \\ \hline Test Case 6 & User repeats Test Case 5 for 10 iterations & The output in the command prompt should look similar Figure 6 playGame function output for each iteration \\ \hline Test Case 7 & & The output in the command prompt should look similar Figure 7 displayFoundWords function output \\ \hline \end{tabular}
Player, please enter your name Figure 2 playGame function, enter player name Karin let's play Boggle Figure 3 playGame function, "let's play Boggle"
Figure 5 playGame function player prompt to enter word r gore v praysame runction vulput ior eacn neration
Figure 7 displayFoundWords function output
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply