Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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,

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 game. Next, more details are provided in successive steps to refine the implementation.

Problem Description: Assume you are hired by a game developing company to write a new computer game for kids. This company has decided to create a version of mastermind with a few different rules hoping that this new game will be more entertaining. If you are unfamiliar with the original game of mastermind, it will help to know how to play. Here is a link that includes the instructions: https://www.wikihow.com/Play-Mastermind This modified version of Mastermind, that you are required to create, is very much like the original game.

The differences between the game are as follows:

Instead of guessing a pattern of colors, you will be guessing a pattern of numbers

The user of the program is always a guesser (the computer creates the pattern) There is a difficulty associated with the game, the difficulty is equal to the amount of numbers to be guessed, and to the range of number that can be possibly guessed

The player has 10 turns to guess the pattern regardless of difficulty There are several steps that you will need to implement:

First ask the player to enter a difficulty (1-10) which indicates how long the pattern will be and the range of numbers to guess. For example, if the difficulty is 4, the length of the pattern will be 4 and the range of numbers will be 1-4, inclusively. Next create a random pattern that the user will guess. For each of the 10 turns, print the current turn and ask the user to guess the pattern. Calculate how many of the guesses are correct and in the correct position. Additionally, calculate how many of the guesses are correct, but not in the correct position. Print these statistics to the screen. If the pattern is guessed perfectly, indicate that the user has succeeded. If the pattern is not guessed within 10 turns indicate that the player has lost. You need to write the stepwise refinement prior to implementing your game so you can show the project manager what you plan to do. You can use the lecture notes to read more about stepwise refinement.

image text in transcribed

main.cpp

#include  #include  using namespace std; void playGame(); int main() { playGame(); return 0; } ///Implement this function void playGame() { ///Implement this function using the Stepwise refinement design approach }

Thank you! Will give a thumbs up!

Initial Problem //Determine whether data set is skewed or not // read data set // process data // determine if data is skewed Iterations 2, 3, and 4 // read data set //**while there is still data // read data from either file //Determine whether data set is skewed or not //* read data set //* while there is still data / read data from either file or keyboard //** increment counter to find # data items // process data //put data in order //determine average // determine standard deviation // determine median //* determine skewness //determine if data is skewed (this process would be continued until every statement is adequately refined using pseudo-code) Initial Problem //Determine whether data set is skewed or not // read data set // process data // determine if data is skewed Iterations 2, 3, and 4 // read data set //**while there is still data // read data from either file //Determine whether data set is skewed or not //* read data set //* while there is still data / read data from either file or keyboard //** increment counter to find # data items // process data //put data in order //determine average // determine standard deviation // determine median //* determine skewness //determine if data is skewed (this process would be continued until every statement is adequately refined using pseudo-code)

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

Distributed Relational Database Architecture Connectivity Guide

Authors: Teresa Hopper

4th Edition

0133983064, 978-0133983067

More Books

Students also viewed these Databases questions