subject
Engineering, 13.03.2020 19:43 tysisson9612

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.

ansver
Answers: 3

Another question on Engineering

question
Engineering, 04.07.2019 08:10
Which of the following is an easy way to remember the modified “x” tire rotation? a. nondrive wheels straight, cross the drive wheels b. drive wheels straight, cross the nondrive wheels c. drive wheels crossed, nondrive wheels straight d. drive wheels crossed, nondrive wheels crossed
Answers: 1
question
Engineering, 04.07.2019 18:10
Carbon dioxide gas expands isotherm a turbine from 1 mpa, 500 k at 200 kpa. assuming the ideal gas model and neglecting the kinetic and potential energies, determine the change in entropy, heat transfer and work for each kilogram of co2.
Answers: 2
question
Engineering, 04.07.2019 18:10
Which one from below is not one of the reasons of planning failures? (clo3) a)-planner is careless. b-planner spend less time in the field but more time on the desk c)-planner is not qualified d)-planner does not have sufficient time to properly plan
Answers: 3
question
Engineering, 04.07.2019 18:20
Inspection for bearing condition will include: (clo4) a)-color b)-smell c)-size d)-none of the above
Answers: 1
You know the right answer?
Background: Stepwise refinement is a low level design technique in which the programmer writes pseud...
Questions
question
Social Studies, 14.10.2019 07:10
Questions on the website: 13722360