Question: Write a program that allows you to write stats of a monster and save it to a file. (for cs132, in binary, cs131 in text

Write a program that

allows you to write stats of a monster and save it to a file. (for cs132, in binary, cs131 in text format) (Things like Name, Hit Points, Minimum damage and Maximum damage.)

Allows you to open the file and read the stats of the monster. (Print what was read onto the screen.)

Extra credit: Allow the program to load the stats of two monsters and let them battle it out.

1. Create monster stats

2. Ask the user if creating or loading

3a. If loading

open file for reading

read stats in from file (fscanf)

print stats to screen

3b. If creating

open file for writing

write stats to file (fprintf) - make sure to leave spaces or returns between variables, so all values do not get smooshed together

Word document please. C program for visual stdios 2017

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!