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, 03.07.2019 15:10
If you were designing a bumper for a car, would you prefer it to exhibit elastic or plastic deformation? why? consider the functions of a bumper in both a minor "fender-bender" and a major collision.
Answers: 1
question
Engineering, 04.07.2019 18:10
The flow rate of air through a through a pipe is 0.02 m5/s. a pitot static tube is placed in the flow. the radius of the pitot static tube is 1 mm. assuming the flow to be steady and the air to be at 300k, calculate the difference in total and static pressure if the diameter of the pipe is: (a) d 0.1 m d 0.05 m (c) d 0.01 m
Answers: 2
question
Engineering, 04.07.2019 18:20
Most leaks in reciprocating air compressors can be detected and minimized by: (clo4) a)-detecting leakage areas using ultrasonic acoustic detector. b)-tightening joints and connections c)-replacing faulty equipment d)-all of the given options
Answers: 2
question
Engineering, 04.07.2019 18:20
Air flows over a heated plate àt a velocity of 50m/s. the local skin factor coefficient at a point on a plate is 0.004. estimate the local heat transfer coefficient at this point.the following property data for air are given: density = 0.88kg/m3 , viscosity 2.286 x 10 ^-5 kgm/s , k = 0.035w/mk ,cp = 1.001kj/kgk. use colburn reynolds analogy.
Answers: 1
You know the right answer?
Background: Stepwise refinement is a low level design technique in which the programmer writes pseud...
Questions
question
Chemistry, 28.06.2021 21:10
question
Mathematics, 28.06.2021 21:10
question
Mathematics, 28.06.2021 21:10
Questions on the website: 13722360