Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need help in lab. i didi checkpoint 1. i m having trouble after it. please help. Evil Hangman In order to begin to build

image text in transcribed

image text in transcribed

image text in transcribed

i need help in lab. i didi checkpoint 1. i m having trouble after it. please help.

Evil Hangman In order to begin to build a Hangman game we need a dictionary of words, Last week you began to build a string opaque object that will help with this task. This week we will continue adding features to the string object to allow us to read and write words from a dictionary. This lab assumes that you have completed all steps involved in labs 1 and 2 Switch to your HANGMAN directory: cdSpring2017/COMP1020/HANGMAN Clean up your directory by typing make clean Add the following declarations to your string.h header file and remember to include stdio.h near the top of the file. //Precondition: hMy_string is the handle to a valid My string object. //Postcondition: hMy string will be the handle of a string object that contains // the next string from the file stream fp according to the following rules. // 1) Leading whitespace will be ignored. // 2) All characters (after the first non-whitespace character is obtained // and included) will be added to the string until a stopping condition is met. The capacity of the string will continue to grow as needed /until all characters are stored 31A stopping condition is met if we read a whitespace character after // we have read at least one non-whitespace character or if we reach // the end of the file. Function will return SUCCESS if a non-empty string is read successfully // and failure otherwise. Remember that the incoming string may aleady // contain some data and this function should replace the data but not // necessarily resize the array unless needed. Status my string_extraction(MY STRING hMy_string, FILE fpl //Precondition: hMy string is the handle to a valid My_string object //Postcondition: Writes the characters contained in the string object indicated // by the handle hMly string to the file stream fp. Function will return SUCCESS if it successfully writes the string and W FAILURE otherwise. Status my string_insertion(MY STRING hMy string, FILE* fpl In addition to following the pre and post-conditions above you need to follow one additional rule for the extraction function. If you read a string from a file stream and then stop on a whitespace then that

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

How Do I Use A Database Research Tools You Can Use

Authors: Laura La Bella

1st Edition

1622753763, 978-1622753765

More Books

Students also viewed these Databases questions

Question

Has the team been empowered to prioritize the issues?

Answered: 1 week ago

Question

b. Does senior management trust the team?

Answered: 1 week ago

Question

c. How is trust demonstrated?

Answered: 1 week ago