Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to write an error free java program following these steps We need to calculate how far a robot moved in the x and

image text in transcribed

I need to write an error free java program following these steps

We need to calculate how far a robot moved in the x and y directions. We prompt the lowly undergraduate research assistant to input the total distance the robot moved and at what angle relative to the x axis. We then want the program to calculate and display how far the robot moved in the x and y directions. Write an error-free Java program to do the following things. Prompt the user to input a number. The number (maybe a decimal) corresponds to the angle that the robot moved relative to the x axis. The user will enter the angle in degrees. 1. Prompt the user to input the total distance that the robot moved from the origin (Assume that the distance is in cm.) 2. The angle is not very accurate, so the angle value entered by the user should be rounded to the nearest integer. Also, if the angle is less than 4 degrees, use the unary increment operator) to add 1 to the (rounded) angle. 4. Display the angle in degrees. If applicable, you should use the value of the angle after it has been rounded and incremented 5. Calculate and display how far the robot moved along the x and y axes. You need to save the results from the x and y values in a variable. (You may assume that the angle is between 0 degrees and 90 degrees.) When you display the x and y results, only display the total distance moved in that direction you do not need to display whether it is in the positive or negative direction 6. The robot can flyt Assume the robot takes of f and flies straight up (z direction) a distance of 12.5 cm. Calculate and display the distance from the origin for the new location

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_2

Step: 3

blur-text-image_3

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

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions

Question

305 mg of C6H12O6 in 55.2 mL of solution whats the molarity

Answered: 1 week ago