coding

  

Background:

Stepwise refinement is a low level design technique in which the programmer writes pseudo-code for what the program is supposed to do in steps, expanding non-obvious steps at each iteration of the process. Eventually, the stepwise refinement will be an almost step by step guideline to the implementation of the program. 

Objective: 

The main objective of this assignment is to assess students’ ability to apply the stepwise refinement process to develop a new algorithm and carry that through to the implementation of the program. Implementation must follow the top-down design approach, where the solution starts by describing the general functionality of a program. Next, more details are provided in successive steps to refine the implementation.

Problem Description:

You are to implement a variant of the Hangman game, where a player must find a hidden, knowing only the first letter and number of letters in the word. The player selects a letter. If the letter is part of the word, the hidden word is updated with all occurrences of the letter. All used letters must be displayed to the player. 

In this variant, the player has 5 lives. Every time a letter is guess correctly the player gains a life. If a letter is guessed wrong, a life is removed. The game terminates if all lives are lost. If a player guesses a word correctly, another word is displayed, and game continues until the player chooses all words correctly or loses all lives. There is a total of 15 words which are read from a file.

Task:

Your task is to apply the technique of stepwise refinement to design an algorithm for the Hangman game. 

You are provided with a function to read the words and store in a string array.

Hint

A string’s individual characters can be accessed as if it was an array of characters.

string x = “hello”;

char y = x[1] //stores character ‘e’ in y

How to Write Step-Wise Refinement

Use a text editor (e.g., the Code::Blocks editor or Notepad) to write the first pseudo-code statement of the problem. Next, add more statements that support the implementation of that first pseudo-code statement. Each time you refine a step, copy and paste the current version of the program design to the end of the text file, then make the change within that pasted version. Stick to the instructor’s convention of using a different number of *s to indicate the level of expansion applicable to each statement (see example below). When the design is complete, the text file will contain a complete record of the design process used to reach the final design. The text file you submit may be quite lengthy and should show the entire process. Do not remove anything and do not just submit the final iteration. Below is a partial example of stepwise refinement (Note it is only a partial example and has nothing to do with the program for this assignment.):

….(this process would be continued until every statement is adequately refined using pseudo-code)

  

Sample Output

Figure 1. Initial Screen

Figure 2. Choosing Correct Letter

Figure 3. Choosing Incorrect Letter

Figure 4. Finding the Word

Figure 5. After Finding First Word

Calculate the price
Make an order in advance and get the best price
Pages (550 words)
$0.00
*Price with a welcome 15% discount applied.
Pro tip: If you want to save more money and pay the lowest price, you need to set a more extended deadline.
We know how difficult it is to be a student these days. That's why our prices are one of the most affordable on the market, and there are no hidden fees.

Instead, we offer bonuses, discounts, and free services to make your experience outstanding.
How it works
Receive a 100% original paper that will pass Turnitin from a top essay writing service
step 1
Upload your instructions
Fill out the order form and provide paper details. You can even attach screenshots or add additional instructions later. If something is not clear or missing, the writer will contact you for clarification.
Pro service tips
How to get the most out of your experience with Homework Mules
One writer throughout the entire course
If you like the writer, you can hire them again. Just copy & paste their ID on the order form ("Preferred Writer's ID" field). This way, your vocabulary will be uniform, and the writer will be aware of your needs.
The same paper from different writers
You can order essay or any other work from two different writers to choose the best one or give another version to a friend. This can be done through the add-on "Same paper from another writer."
Copy of sources used by the writer
Our college essay writers work with ScienceDirect and other databases. They can send you articles or materials used in PDF or through screenshots. Just tick the "Copy of sources" field on the order form.
Testimonials
See why 20k+ students have chosen us as their sole writing assistance provider
Check out the latest reviews and opinions submitted by real customers worldwide and make an informed decision.
Political science
Thank you!
Customer 452701, February 12th, 2023
Business Studies
Great paper thanks!
Customer 452543, January 23rd, 2023
Political science
I like the way it is organized, summarizes the main point, and compare the two articles. Thank you!
Customer 452701, February 12th, 2023
Finance
Thank you very much!! I should definitely pass my class now. I appreciate you!!
Customer 452591, June 18th, 2022
Education
Thank you so much, Reaserch writer. you are so helpfull. I appreciate all the hard works. See you.
Customer 452701, February 12th, 2023
Technology
Thank you for your work
Customer 452551, October 22nd, 2021
Psychology
Thank you. I will forward critique once I receive it.
Customer 452467, July 25th, 2020
Psychology
I requested a revision and it was returned in less than 24 hours. Great job!
Customer 452467, November 15th, 2020
Accounting
Thank you for your help. I made a few minor adjustments to the paper but overall it was good.
Customer 452591, November 11th, 2021
11,595
Customer reviews in total
96%
Current satisfaction rate
3 pages
Average paper length
37%
Customers referred by a friend
OUR GIFT TO YOU
15% OFF your first order
Use a coupon FIRST15 and enjoy expert help with any task at the most affordable price.
Claim my 15% OFF Order in Chat
Show more
<