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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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