Question: Solve stages 1 , 2 and 3 using C coding language: Stage 1 Define four arrays, two for the database and two for the player's

Solve stages 1,2 and 3 using C coding language:
Stage 1
Define four arrays, two for the database and two for the player's creatures. (the sample file on the course website will
help with this)
Use of a 2-dimensional (2D) array to store the creature names, i.e 2 D creature array -10 rows 21 columns
(21 accounts for null value).
Use of a 2-dimensional (2D) integer array to store creature stats (health and attack) i.e.2D integer array -10
rows 2 columns.
For example (note the use of symbolic constants, i.e., #define MAX_CREATURES 10, etc):
Define a 2D array of creatures to store the creatures' names. For example:
char db_creatures[MAX_CREATURES][STRING_LENGTH]={'\0'};
Define a 2D array of integers to store the creatures' stat information. For example:
int db_stats [MAX_CREATURES][STATS_COUNT]={0};
Stage 2
Write the code for functions read_creature_file() and display_creatures () as specified above. Add code
to call these two functions to ensure they are working correctly. You may write your own read_creature_file()
function or you may use the one provided for you. A sample read_creature_file() function will be posted online
by week 8.
For example, given the provided databaseCreatures. txt file, your array should now look like this:
db_creatures
(2D array of creatures) to store creature names
db_stats
(2D array of integers) to store
stats
Stage 3
Now that you know that the information is being correctly stored in your creature and health arrays, write the code for
function write_to_file(). Add code to call this function to ensure it is working correctly. Your .txt files outputted
should match the same format as the input files.
 Solve stages 1,2 and 3 using C coding language: Stage 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!