20.1 Programming paradigms
145 questions in this subtopic. Open a question to solve it and check the official answer.
Programming paradigms · 4 marks · official answer ready
(c) The class Character stores data about the characters in the game. Each character has a skill level for each type of event. The skill level is an integer between 1 and 5 inclus…
Programming paradigms · 4 marks · official answer ready
(d) The method CalculateScore() in the Character class calculates and returns the percentage chance of a character completing an event. When a character’s skill level is greater t…
Programming paradigms · 0 marks
1 A computer game is designed for users to select characters. Each character can take part in a group of events. Each group has five events. There are four types of event: jump, s…
Programming paradigms · 2 marks · official answer ready
(i) Amend the main program to declare and create an instance of a Character object for Tarz and for Geni. Save your program. Copy and paste the program code into part 1(e)(i) in t…
Programming paradigms · 7 marks · official answer ready
(ii) Both characters Tarz and Geni take part in each event in the group you created in part 1(b). These steps are repeated for all five events: • The percentage chance of each cha…
Programming paradigms · 1 mark · official answer ready
(iii) Test your program. Take a screenshot of the output. Save your program. Copy and paste the screenshot into part 1(e)(iii) in the evidence document. [1] 8
Programming paradigms · 4 marks · official answer ready
(i) Write program code to declare the class Horse and its constructor. Do not declare the other methods. Use your programming language’s appropriate constructor. All attributes mu…
Programming paradigms · 3 marks · official answer ready
(ii) The get methods GetName() and GetMaxFenceHeight() each return the relevant attribute. Write program code for the get methods. Save your program. Copy and paste the program co…
Programming paradigms · 5 marks · official answer ready
(i) The program has two horses: • The horse named ‘Beauty’ can jump a maximum height of 150 cm and has a success percentage rate of 72%. • The horse named ‘Jet’ can jump a maximum…
Programming paradigms · 1 mark · official answer ready
(ii) Test your program. Take a screenshot of the output. Save your program. Copy and paste the screenshot into part 2(b)(ii) in the evidence document. [1] 8
Programming paradigms · 4 marks · official answer ready
(i) Write program code to declare the class Fence, its constructor and get methods. Use your programming language’s appropriate constructor. All attributes must be private. If you…
Programming paradigms · 5 marks · official answer ready
(ii) The array Course stores four Fence objects. The user inputs the height and risk for each fence, and these are validated before each fence is created. Amend the main program t…
Programming paradigms · 5 marks · official answer ready
(d) The chance of a horse jumping a fence without knocking it down is calculated as follows. If the height of the fence is more than the maximum height a horse can jump, the succe…
Programming paradigms · 3 marks · official answer ready
(i) Write program code to amend the main program to: • calculate and output the chance of the first horse jumping each of the four fences without knocking each fence down • calcul…
Programming paradigms · 2 marks · official answer ready
(ii) Write program code to amend the main program to: • calculate and output the average chance of success for each horse jumping over all four fences without knocking each fence …
Programming paradigms · 2 marks · official answer ready
(iii) Test your program with the following input data for four fences: Height Risk 152 5 121 1 130 3 145 4 Take a screenshot of the output. Save your program. Copy and paste the s…
Programming paradigms · 4 marks · official answer ready
(i) Write program code to declare the class Node and its constructor. Do not declare the other methods. Use the appropriate constructor for your programming language. If you are w…
Programming paradigms · 3 marks · official answer ready
(ii) The get methods GetLeft(), GetRight()and GetData()each return the relevant attribute. Write program code for the three get methods. Save your program. Copy and paste the prog…
Programming paradigms · 3 marks · official answer ready
(iii) The set methods SetLeft(), SetRight()and SetData()each take a parameter and then store this in the relevant attribute. Write program code for the three set methods. Save you…
Programming paradigms · 4 marks · official answer ready
(i) Write program code to declare the class TreeClass and its constructor. Do not declare the other methods. Use the appropriate constructor for your programming language. If you …
