140k views
0 votes
9. Write the pseudo-code for a conditional code: on the condition 'weapon is empty' then 'load weapon', otherwise on condition 'weapon is loaded' then 'fire weapon', otherwise 'search for ammo'. (3p+s) (Note: Abide by correct pseudo-code format using statement keywords, brackets, parentheses, indentation, line breaks.)

User Sweetz
by
8.7k points

1 Answer

5 votes

Final answer:

The pseudo-code for the conditional code on the given conditions is provided, including 'load weapon' if it's empty, 'fire weapon' if it's loaded, and 'search for ammo' if neither.

Step-by-step explanation:

If weapon is empty then

load weapon

Otherwise, if weapon is loaded then

fire weapon

Otherwise

search for ammo

User Endre Olah
by
8.5k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.