Define selection and provide an example of how it is used in a program
Did this page help you?
Exam code: H446
Define selection and provide an example of how it is used in a program
How did you do?
Did this page help you?
Define the term 'iteration', and state how it is different from selection.
How did you do?
Did this page help you?
Explain how logical conditions affect the flow of a program, and describe the role of Boolean operators in these conditions.
Provide an example.
How did you do?
Did this page help you?
Describe the difference between a flowchart and pseudocode when designing algorithms, and give one advantage of each.
How did you do?
Did this page help you?
The characters and prizes are designed as separate classes. 10 of the spaces on the road will contain an instance of the class Prize. The other spaces will be empty.
The class design for Prize
is here
|
|
|
new()
is the constructor method. The name, type and value are passed to the constructor as parameters which then assigns these to the attributes.
The game starts with 10 prizes. Each prize is allocated to one space on the road.
An algorithm needs designing that will generate a random space on the road for each prize. Each road space can only store one prize.
Describe the decisions that will need to be made in this algorithm and how these will affect the program flow.
How did you do?
Did this page help you?