Question: java NetBeans Apache 12.2 We are going to build a simulator for a lunar lander. We have to send it commands to prepare it to

java NetBeans Apache 12.2
We are going to build a simulator for a lunar lander.

We have to send it commands to prepare it to land.

track distance from surface - start at 10

have a variable for x axis tilt and y axis tilt, start as random values between -10 and 10

commands we can send are:

x axis tilt positive or negative - this changes the value by +1 or -1

y axis tilt positive or negative - this changes the value by +1 or -1

thruster - increase distance from surface by 2 ( pretend we have unlimited fuel )

do nothing - don't change any tilt

activate self destruct sequence -

if this is used, ask the user for the cancelation code ( make up some value ), and don't let them enter other commands until they cancel

if the command entered doesn't match, give the user a list of valid commands

Inside a loop that runs until it has landed ( distance to surface is 0 )

ask for a command, do the command or give them the valid of list of commands

distance from surface goes down by 1 if a valid command was entered

if we landed and the x and y tilts are not 0, the lander breaks, game over, otherwise we win

all of this goes into another loop asking if they want to play again.

it is in line command interface

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!