Tasks Activity boggle.c 1. Copy the C source code file from Assignment 2 and rename it for Assignment 3 2. Write the pre

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

Tasks Activity boggle.c 1. Copy the C source code file from Assignment 2 and rename it for Assignment 3 2. Write the pre

Post by answerhappygod »

Tasks Activity Boggle C 1 Copy The C Source Code File From Assignment 2 And Rename It For Assignment 3 2 Write The Pre 1
Tasks Activity Boggle C 1 Copy The C Source Code File From Assignment 2 And Rename It For Assignment 3 2 Write The Pre 1 (85.17 KiB) Viewed 46 times
Tasks Activity Boggle C 1 Copy The C Source Code File From Assignment 2 And Rename It For Assignment 3 2 Write The Pre 2
Tasks Activity Boggle C 1 Copy The C Source Code File From Assignment 2 And Rename It For Assignment 3 2 Write The Pre 2 (68.59 KiB) Viewed 46 times
Tasks Activity Boggle C 1 Copy The C Source Code File From Assignment 2 And Rename It For Assignment 3 2 Write The Pre 3
Tasks Activity Boggle C 1 Copy The C Source Code File From Assignment 2 And Rename It For Assignment 3 2 Write The Pre 3 (106.6 KiB) Viewed 46 times
Tasks Activity Boggle C 1 Copy The C Source Code File From Assignment 2 And Rename It For Assignment 3 2 Write The Pre 4
Tasks Activity Boggle C 1 Copy The C Source Code File From Assignment 2 And Rename It For Assignment 3 2 Write The Pre 4 (88.04 KiB) Viewed 46 times
Tasks Activity Boggle C 1 Copy The C Source Code File From Assignment 2 And Rename It For Assignment 3 2 Write The Pre 5
Tasks Activity Boggle C 1 Copy The C Source Code File From Assignment 2 And Rename It For Assignment 3 2 Write The Pre 5 (73.9 KiB) Viewed 46 times
Tasks Activity Boggle C 1 Copy The C Source Code File From Assignment 2 And Rename It For Assignment 3 2 Write The Pre 6
Tasks Activity Boggle C 1 Copy The C Source Code File From Assignment 2 And Rename It For Assignment 3 2 Write The Pre 6 (41.94 KiB) Viewed 46 times
Tasks Activity Boggle C 1 Copy The C Source Code File From Assignment 2 And Rename It For Assignment 3 2 Write The Pre 7
Tasks Activity Boggle C 1 Copy The C Source Code File From Assignment 2 And Rename It For Assignment 3 2 Write The Pre 7 (34.5 KiB) Viewed 46 times
Tasks Activity Boggle C 1 Copy The C Source Code File From Assignment 2 And Rename It For Assignment 3 2 Write The Pre 8
Tasks Activity Boggle C 1 Copy The C Source Code File From Assignment 2 And Rename It For Assignment 3 2 Write The Pre 8 (23.73 KiB) Viewed 46 times
Tasks Activity boggle.c 1. Copy the C source code file from Assignment 2 and rename it for Assignment 3 2. Write the preprocessor command to include the time.h header file from the C library 3. Write the preprocessor command to include the string.h header file from the C library 4. After the #include preprocessor commands add the following macros to create constants for the program a. DICE with the value of 16 b. SIDES with the value of 6 c. TRUE with the value of 1 d. FALSE with the value of 0 e. SPACE with the value of (i.e. there is ONE explicit space between the open/close'; source code will not compile without the space) 5. Update the function declaration or prototype for function display Board 6. Write the function declaration or prototype for function display Dice 7. Write the function declaration or prototype for function createBoard 8. Write the function declaration or prototype for function getLetter 9. Update the main function to do the following a. At the beginning of the main function, declare the following local variables
i. Two-dimensional array (i.e. dice), data type character, size: 16 rows, 6 columns (i.e. use the constants), initialized to the data in Table 1 Boggle Data ii. Two-dimensional array (i.e. board), data type character, size: 4 rows, 4 columns (i.e. use the constants) iii. One-dimensional array (i.e. usedDie), data type integer, size: 16 columns (i.e. use the constants) b. Call function memset to initialize the usedDie array so all elements equal 0, passing the following arguments i. usedDie array ii. 0 (i.e. use the constants) iii. sizeof(used Die) c. Call function memset to initialize the board array so all elements equal an explicit space (i.e.), passing the following arguments i. board array ii. iii. sizeof(board) (i.e. use the constants) d. Call function srand, pass as an argument function time(0) e. Comment out or delete the two consecutive functions calls a. display ExplicitBoard(); b. clearScreen(); f. Call function display Dice passing as an argument 2d array dice g. Call function clearScreen h. Call function createBoard, passing as arguments a. 2d array dice b. 2d array board c. 1d array usedDie i. Call function display Board, passing as an argument 2d array board 10. Update function displayBoard to do the following a. Update parameter list to include two-dimensional array (i.e.
board), data type character, size: 4 rows, 4 columns (i.e. use the constants) b. Comment out or delete local variables i. ii. num letter c. Output to the screen using function printf the first three rows of the boggle board d. Write a for loop to loop through the number of rows (i.e. use constant ROWS) i. Write a for loop to loop through the number of columns (i.e. use constant COLS) 1. Comment out or delete the lines of code that 4 a. // generate the random number b. // convert number to character based on decimal value 2. Output to the console the character stored in the 2d array board at the current row/col location 11. Write function displayDice to do the following a. Return type void b. Parameter list includes
size: 16 rows, 6 columns (i.e. use the constants) c. Declare the following local variables i. Data type integer (i.e. row) ii. Data type integer (i.e. col) d. Write a nested for loop to loop through the 2d array dice i. Output to the console the characters stored in the array 12. Write function getLetter to do the following a. Return type char b. Parameter list includes i. Two-dimensional array (i.e. dice), data type character, size: 16 rows, 6 columns (i.e. use the constants) ii. Data type integer, (i.e. row) c. Declare the following local variables i. Data type character (i.e. letter) ii. Data type integer (i.e. col) d. Set variable col equal to randomly selecting a value from 0- 5 (i.e. use the constants) e. Set variable letter equal to the element in the 2d array dice at the row/col location f. Return variable letter 13. Write function createBoard to do the following a. Return type void b. Parameter list includes i. Two-dimensional array (i.e. dice), data type character, size: 16 rows, 6 columns (i.e. use the constants) ii. Two-dimensional array (i.e. board), data type character, size: 4 rows, 4 columns (i.e. use the constants) iii. One-dimensional array (i.e. usedDie), data type integer, size: 16 columns c. Declare the following local variables i. Data type character (i.e. letter) ii. Data type integer, (i.e. row) iii. Data type integer, (i.e. col) iv. Data type integer (i.e. die) d. Write a loop to loop through the 4 rows (i.e. use the
Boggle executable constants) of the board array Test Case 1 | Test Case 1 Test Case 2 Test Case 3 Test Case 4 Test Case 5 i. Initialize variable col to 0 1. While variable col is less than 4 (i.e. use the constants) a. Set variable die equal to randomly selecting a value from 0-15 (i.e. use the constants) b. If the die has not been used (i.e. check the usedDie array at the location) i. Set variable letter equal to function call getLetter, passing as arguments 1. 2d array dice 2. Local variable die ii. Set array parameter board, at the current row/col location, equal to the value stored in variable letter passes Test Case 2 passes Test Case 3 passes Test Case 4 passes Test Case 5 passes Source compiles with no warnings Source compiles with no errors Source runs with no errors Source includes comments iii. Set array parameter usedDie, at the current die location, equal to 1 (i.e. use the constants) iv. Increment the loop control variable
Perform the following test cases Test Cases Test Case 1 Test Case 2 Test Case 3 Test Case 4 Test Case 5 Action Run executable User clicks the Enter key User clicks the Enter key Expected outcome When the executable runs, the output in the command prompt should look like Figure 1 Welcome screen function output The screen is cleared of the welcome screen The output in the command prompt should look similar Figure 2 display Dice function output 6 The screen is cleared of the dice data The output in the command prompt should look similar Figure 3 Boggle board display Board() function output; the Boggle board will most likely be different than the image, it is randomly generated
BBBBB 0000 GGGGG GG BB BB 00 00 GG BBBBB 00 00 GG GG BB BB 00 00 GG GGG GG GGG BBBBB 0000 RULES OF THE GAME: GGGGG LL LL LL LL GGGGGG GGGGGG LLLLLL EEEEEE EE EEEE EE EEEEEE 1. The player is presented with a Boggle board 2. The player will have three minutes to find as many words as possible. 3. Words must contain three letters or more. 4. Words are formed from adjoining letters. 5. Letters must join in the proper sequence to spell a word. 6. Letters may join horizontally, vertically, or diagonally, to the left, right, up or down. 7. No letter cube may be used more than once in a single word. 8. Words submitted will be scored accordingly. 9. Good luck! Hit <ENTER> to continue! Figure 1 Welcome screen function output
BOGGLE DICE Die 1 DRL XEI Die 2 CPOHSA Die 3 NHNL ZR Die 4 ΝΤΟΟΤΑ Die 5 I OSSET Die 6 NWEGHE Die 7 BOOJA B Die 8 UIENES Die 9 PSAFKF Die 10 I UN H M Q Die 11 YRD VEL Die 12 VEHWHR Die 13 I OTMUC Die 14 TYELTR Die 15 STITYD Die 16 AGA EEN Hit <ENTER> to continue! Figure 2 displayDice function output
H B | BOGGLE BOARD S | V | A | W | D | T | H | M | I | P | U | E | G | S | Figure 3 Boggle board displayBoard 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