Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

must do this and work in netbeans We are going to build a simulator for a lunar lander. We have to send it commands to

must do this and work in netbeans

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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago