This program is a revision to an already existing program. The revision adds a function called display_hidden_word. The function prototype void display_hidden_word(char *s); The function should print out hidden word to terminal as a series of underscores separated by blanks. If the secret word is "test", the function will print: _ _ _ _
It will print 4 underscores separted by blanks, 4 for the letters in the word blue. If the phrase contains a blank, the function should print a blank, also surrounded by blanks. For example if the phrase is "I am happY" it will print:
_ _ _ _ _ _ _ _
It should print 3 blanks between each word. The function must deal with its argument as a character pointer, not as an array, although it is declared in the main function as an array.
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
Here is original program:
#include <stdio.h>
#define size 256
int count_letter(char[],char);
int main()
{
char buffer[size] = "computer";
char c;
int sent = 0;
printf("Can you guess my secret word?\n");
/*Here is where function call should be.*/
while(1)
{
printf("Enter letter:");
c = getch();
if(c == 'q')
break;
else
{
sent=count_letter(buffer,c);
printf("\nThe letter %c appears %d times in secret word. \n",c,sent);
}
}
printf("\nGood-bye!");
getch();
}
int count_letter(char buffer[], char c)
{
int index;
int letter=0;
for(index=0;index<strlen(buffer);index++)
{
if(buffer[index]== c)
letter++;
}
return (letter);
}