Write a program that reads letters from a file

Assignment Help C/C++ Programming
Reference no: EM13936756

Using only C (not c++) design the program described

General Requirements

- Write a program that reads letters from a file called"inputLet.txt".

- Your program will ask the user to enter the number of games they wish to play (1 to 4)

- This program should open an inputLet.txt file , read in one character at a time and repeat this for the number of games the user wants to play.

- the test file will contain at least 15 letters, all lowercase

- When the number of games has been played, the program will end

- A preprocessor directive must be used to define the maximum number of guesses as 5

- If the player has used up all of their guesses, a message that the game is over should be displayed along with the letter they were trying to guess.

- You must have at least 4 user defined functions as follows:

//this function provides instructions to the user on how to play the game
void Instructions( );

//this function runs one game. It for checks either 5 incorrect guesses or correct guess.
//It returns a 0 if the game is over and the player did not guess the letter, otherwise it returns 1.

int PlayGuess(char solution);

//this function prompts the player to make a guess and returns that guess
//this function is called from inside the PlayGuess( ) function described above
char GetLetter( );

//this function takes two arguments, the guess from the player
//and the solution letter from the file.
//It lets the user know if the guess comes alphabetically before or after the answer
//The function returns 1 if the guess matches the solution and returns a 0 if they do not match
int CompareLetters(char guess, char solution);

Additional Requirements:

- Use function prototypes.

- Write comments for each function that will appear in the file before each prototype and again before each function definition.

- Be sure to comment your code adequately.

- Be sure to indent properly.

- Use meaningful variable names

Reference no: EM13936756

Questions Cloud

Introduce a few areas of programming using c : In this project it was required to write a small Notepad program and it will introduce a few areas of programming using C# (which are very important in many programs), including: Windows Forms and the Event Handling model GUI (Graphical User Inter..
Research on woolworths supermarket : Students must research Woolworth's Supermarket. Students are to write an Integrated CRM Strategy Plan in Report Format.
Algorithm that returns the smallest value in the array : Write an algorithm that outputs the smallest and second smallest values in the array.
Describe the artwork in terms of subject : Describe the artwork in terms of subject, medium, composition, and use of color. Classify the work of art, highlighting the style, movement, and any innovation the artist displayed
Write a program that reads letters from a file : This program should open an inputLet.txt file , read in one character at a time and repeat this for the number of games the user wants to play.
Describe the biological consequences of the protein : Discuss why RNA polymerases are not able to correct base errors during replication or transcription. Describe the biological consequences of the protein that may develop in this case.
Describe three features of a good balanced scorecard : Describe three features of a good balanced scorecard. What are three important pitfalls to avoid when implementing a balanced scorecard? How does an engineered cost differ from a discretionary cost?
Australian marketing institute code of professional conduct : Why is it important to abide by the provisions of the Australian marketing institute code of professional conduct?
What is the frequency of heterozygotes for the allele : If heterozygotes for the beta-thalassemia allele are protected against malaria, what is the selection coefficient s1 aganist homozygotes for the normal allele? Again, what assumption must you make in your calculation?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Maturity amount after the period of deposit

Develop a program that accepts a deposit amount and period of deposit. Calculate the maturity amount after the period of deposit. The bank pays 4% interest per year for any deposits made in the bank.

  Using opengl to create a cube

Write a program in C/C++ using OpenGL to create (without using built in function) a cube by implementing translation algorithm by translating along 1. X-axis, 2.Y-axis and 3. X and Y plane

  Containing all the genes in the dna sequence

As described above plus an integer reference parameter, and return a dynamically-allocated array of strings containing all the genes in the DNA sequence. Each string in the array will contain a unique

  Explain in a one to two 1-2 page narrative a use case

as an intern software developer for a retail bank you have been tasked with developing use cases to support the atm

  Create a job class that holds a job id

Create a Job class that holds a Job ID number and the cost of the Job. Include insertion and extraction operators. Create a JobException class that holds a Job and an error message

  Design a modular program that asks the user

A retail company must file a monthly sales tax report listing the total sales for the month, and the amount of state and county sales tax collected. The state sales tax rate is 4 percent and the county sales tax rate is 2 percent. Design a modular..

  Template class definition

You have the following template class definition.  template  class mypair {

  Design a program that uses a loop to display

Running on a particular treadmill you burn 3.9 calories per minute. Design a program that uses a loop to display the number of calories burned after 10,15,20,25,30 minutes?

  Write a program that will be used to gather statistical

write a program that will be used to gather statistical data about the number of movies college students see in a

  Multidimensional arrays

multidimensional arrays to life, let's consider a specific example: How can you visualize a 4-dimensional array? How can you give meaning to each dimension this array has? What kind of application would such an array be useful for?

  Write a program that reads a sequence of names one per line

Write a program that reads a sequence of names, one per line, and then sorts and prints them. Write and test a function to reverse a C-string in place, without any duplication of characters.

  Write a program to generate a table of factors

Write a program to generate a table of factors used to compute monthly payments for the money borrowed.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd