Define selection and provide an example of how it is used in a program
Was this exam question helpful?
Exam code: H446
Define selection and provide an example of how it is used in a program
How did you do?
Was this exam question helpful?
State how 'iteration' is different from 'selection'.
How did you do?
Was this exam question helpful?
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?
Was this exam question helpful?
Describe the difference between a flowchart and pseudocode when designing algorithms, and give one advantage of each.
How did you do?
Was this exam question helpful?
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?
Was this exam question helpful?
Explain how decision statements and logical conditions control the flow of a program.
How did you do?
Was this exam question helpful?