Engineering
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.

answer
Answers: 3

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 16:10, TheOriginalMeyah
An electrical motor raises a 50kg load at a construct velencity .calculate the power of the motor, if it takes 40sec to raise the load through a height of 24m(take g =9.8n/g)
Answers: 2
image
Engineering, 04.07.2019 18:10, anna22684
Water at 70°f and streams enter the mixing chamber at the same mass flow rate, determine the temperature and the quality of the exiting stream. 0 psia is heated in a chamber by mixing it with saturated water vapor at 20 psia. if both streams enters the mixing chamber at the same mass flow rate, determine the temperature and the quality of the existing system.
Answers: 2
image
Engineering, 04.07.2019 18:10, Talos02
Burgers vector is generally parallel to the dislocation line. a)-true b)-false
Answers: 2
image
Engineering, 04.07.2019 18:10, samanthabutryn
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
Do you know the correct answer?
Background: Stepwise refinement is a low level design technique in which the programmer writes pseud...

Questions in other subjects:

Konu
Mathematics, 13.11.2020 19:40
Konu
Mathematics, 13.11.2020 19:40