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 18:10
Ahot wire operates at a temperature of 200°c while the air temperature is 20°c. the hot wire element is a tungsten wire of 5 um diameter and 2 mm in length. plot using excel current, heat transfer and heat generated by the wire for air velocity varying from 1-10 m/s in steps of lm/s? matlab the sensor voltage output, resistance, or assume nu 0.989 re033pr13 take air properties at tr (200°c20°c)/2 = 110°c properties of tungsten: c 0.13 kj/kg.k 3 p 19250 kg/m k (thermal conductivity) = 174 w/m.k
Answers: 2
question
Engineering, 04.07.2019 18:20
Describe one experiment in which the glass transition temperature and melting temperature of a totally amorphous thermoplastic material can be determined. show the relevant experimental results in a diagram which should be properly annotated with the two temperatures clearly marked. what is likely to happen to the curve in the diagram if the amorphous polymer is replaced by a thermosetting type?
Answers: 2
question
Engineering, 04.07.2019 19:10
Estimate the change in specific internal energy au and specific enthalpy h from inlet to outlet for ethylene glycol (a liquid) flowing through each of the following devices: (a) a heat exchanger where the glycol temperature increases from 20 °c to 80 °c; (b) a pump operating at about 25 °c and increasing the glycol pressure from 100 kpa to 8 mpa.
Answers: 2
question
Engineering, 04.07.2019 19:20
Air enters a horizontal, constant-diameter heating duct operating at steady state at 290 k, 1 bar, with a volumetric flow rate of 0.25 m°/s, and exits at 325 k, 0.95 bar. the flow area is 0.04 m2. assuming the ideal gas model with k = 1.4 for the air, determine (a) the velocity at the inlet and exit, each in m/s, and (c) the rate of heat transfer, in kw flow rate, in kg/s, (b) the mass kg 0.3
Answers: 2
You know the right answer?
Background: Stepwise refinement is a low level design technique in which the programmer writes pseud...
Questions
question
Mathematics, 25.10.2019 04:43
Questions on the website: 13722361