0 results for
ICT
Computing
Responsive image

Designing the Solution

My Flight Path
Flight Path
Learning Objectives
0 results forGuest
GradeSkill_name
 3 I can write an Overview of the task I have been given.
 3 I can create an Overview Flow Chart for the task I have been given.

Strength

Improvement

Targets

Progress this topic

0%


Overall Progress for this unit

NAN%


LO3 :- I can write an Overview of the task I have been given.

Designing the solution

Below is an example of the explanation for the overall design solution for the Cows and Bulls game.

Example

The program is a game of Cows and Bulls. The aim of the game is to guess a 4 digit number that has been randomly generated. To help guessing the player will get hints to say what numbers are correct and in the right place (bulls) or correct but in the wrong place (cows)..

The program will be created using python programming language and using the IDLE IDE.

The first part of the program needs to generate a number and make sure the 4 numbers are not repeated. The python random module should be imported into the program, in order to generate a random number. The generated number will be the format of a python list of 4 digits, so that the values can be looped through.

The python function randrange() can be used to generate a single number between 0 and 9, as required in the scenario. A loop is needed to do this 4 times and check that the number is not duplicated, by comparing each new number to those generated in previous iterations of the loop. See Flow Chart 2.

The program needs to allow the player to enter a guess and continue doing this until the generated number is guessed or they type exit. See Flow Chart 1.

The user entered number needs to be validated to ensure it is a four digit number without duplicates. A loop is needed to check each digit in the number and ensure it is not used twice or more. See Flow Chart 3.

The user entered number needs to be compared to the random generated number. To do this each digit in the user number is compared to the digit in the same position in the random number. If they are equal then 1 will be added to the bulls counter. If the user digit is not in the same position but is in the random number anyway then 1 is added to the cows counter. Flow Chart 4.


LO4 :- I can create an Overview Flow Chart for the task I have been given.

Overview Flow Chart

Below is an example of a Flow chart for the overall Design solution for the Cows and Bulls game.

Example

control


0 results forGuest
Recent Comments

Teacher Date: 2019-10-21


Guest Sep 28, 2014, 10:15 PM