The partially completed pseudocode for an algorithm to estimate the total flight energy used by a delivery drone is shown below. It uses a user-devised subprogram.
Complete the pseudocode by supplying the correct terms, parameters, or statements for the blanks on Line 14, Line 15, Line 29, and Line 39.
12 SET statusMessage TO "System ready for drone simulation"
13
14 _____ estimateFlightEnergy ( _____ )
15 BEGIN _____
16 SET statusMessage TO "Calculating power profile..."
17 # calculate basic drag factor
18 SET dragForce TO inSpeed * inWeight
19
20 # total energy includes drag and wind resistance
21 SET totalEnergy TO (dragForce * 1.4) + inWindEffect
22
23 # display breakdown
24 SEND statusMessage TO DISPLAY
25 SEND "Estimated Energy (Wh): " & totalEnergy TO DISPLAY
26 SEND "Cruising Speed (m/s): " & inSpeed TO DISPLAY
27 SEND "Cargo Weight (kg): " & inWeight TO DISPLAY
28 SEND "Wind Effect Factor: " & inWindEffect TO DISPLAY
29 END _____
30
31 SEND statusMessage TO DISPLAY
32 # input flight parameters
33 SEND "Enter average cruising speed (m/s):" TO DISPLAY
34 RECEIVE flightSpeed FROM (REAL) KEYBOARD
35 SEND "Enter cargo weight (kg):" TO DISPLAY
36 RECEIVE cargoWeight FROM (REAL) KEYBOARD
37 SEND "Enter headwind impact factor:" TO DISPLAY
38 RECEIVE windFactor FROM (REAL) KEYBOARD
39 _____
Practise Edexcel GCSE Computer Science Subprograms with exam-style questions for GCSE Computer Science. 29 questions covering Built-in and user-devised subprograms, Functions versus procedures, and Global and local variables, matched to the Edexcel GCSE Computer Science (1CP2) specification and written in Paper 1 and Paper 2 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.