A computer program is designed to simulate horses doing show jumping. In show jumping, horses jump over obstacles called fences. A horse successfully jumps a fence if it does not knock the fence down. The program is written using Object-Oriented Programming (OOP). The class Horse stores data about the horses. 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 - calculate and output the chance of the second horse jumping each of the four fences without knocking each fence down. All outputs must have appropriate messages including the name of the horse and the fence number. An example output for one horse jumping two fences is: "The horse Fox at fence 1 has a 68% chance of success The horse Fox at fence 2 has a 72% chance of success" Save your program. Copy and paste the program code into part 2(e)(i) in the evidence document. (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 down (the average is the total of values divided by the quantity of values). An example output for one horse jumping all of the fences is: "The horse Fox has an average 70\% chance of jumping over all four fences" - output the name of the horse that has the highest average chance of success. You can assume that each average will be different. All outputs must have appropriate messages. Save your program. Copy and paste the program code into part 2(e)(ii) in the evidence document. (iii) Test your program with the following input data for four fences: Take a screenshot of the output. Save your program. Copy and paste the screenshot into part 2(e)(iii) in the evidence document.
Exam No:9618_w24_qp_41 Year:2024 Question No:2(e)
Answer:





Knowledge points:
19.1 Algorithms
20.1 Programming Paradigms
Solution:
Download APP for more features
1. Tons of answers.
2. Smarter Al tools enhance your learning journey.
IOS
Download
Download
Android
Download
Download
Google Play
Download
Download