Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 and using C coding language:
Stage
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 dimensional D array to store the creature names, ie D creature array rows columns
accounts for null value
Use of a dimensional D integer array to store creature stats health and attack ieD integer array
rows columns.
For example note the use of symbolic constants, ie #define MAXCREATURES etc:
Define a D array of creatures to store the creatures' names. For example:
char dbcreaturesMAXCREATURESSTRINGLENGTH;
Define a D array of integers to store the creatures' stat information. For example:
int dbstats MAXCREATURESSTATSCOUNT;
Stage
Write the code for functions readcreaturefile and displaycreatures as specified above. Add code
to call these two functions to ensure they are working correctly. You may write your own readcreaturefile
function or you may use the one provided for you. A sample readcreaturefile function will be posted online
by week
For example, given the provided databaseCreatures. txt file, your array should now look like this:
dbcreatures
D array of creatures to store creature names
dbstats
D array of integers to store
stats
Stage
Now that you know that the information is being correctly stored in your creature and health arrays, write the code for
function writetofile 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started