Select Page

CS 1050 DnD Monster Scores Project Program

Question Description

DescriptionFor the prelab assignment, you need to read a text file. The input data file will be called “DnDMonsterScores.csv”. Thistype of file can be opened by spreadsheet programs such as Microsoft Excel, but you can also open it with a text editor likeVIM or Notepad. Of course, you can open it and read it with your program too!The data file consists of a name followed by numbers on each line (except the first line – the first line is a “header” and hasthe word “Name” followed by the word “AC” followed other words representing the name of each “field”, all separated bycommas). All of these “fields” are separated by commas. For example:Name,AC,HP,STR,DEX,CON,INT,WIS,CHAFrog,11,1,1,13,8,1,8,3Sea Horse,11,1,1,12,8,1,10,2Shrieker,5,13,1,1,10,1,10,3The file is meant to represent the name of a “monster” in the game Dungeons and Dragons followed by the “armor class”and then the “hit points”, etc. for that monster.To get started on this prelab, type the following while logged in to tc.rnet.missouri.edu:cs1050start prelab11This command will create a directory called prelab11. Go into that directory (“cd prelab11”) and get a list of the files there(“ls -la”). Notice that there is a file called prelab11.c. You can start editing this file to do your prelab (but you probablywant to change the header since it says it was written entirely by me ). Notice that the data file (DnDMonsterScores.csv)is also in this directory.Your program should read in all of the data (ignoring the “header”), count how many monsters are in the file, and calculatethe average armor class (AC) as well as the average hit points (HP) for the monsters in this file. As you process the file, youshould output the number (count) of the current monster, its name, its armor class, and its hit points (see sample output).You can read in the other fields as you go or find a way to ignore them

"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you "A" results."

Order Solution Now