Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Procedural Programming Lab 6 You are to write and execute code for the following problems. When you are done, capture a screenshot of output and

image text in transcribed
Procedural Programming Lab 6 You are to write and execute code for the following problems. When you are done, capture a screenshot of output and turn it in with the source code via Blackboard. Spacecraft You are to write a program for a spacecraft so that astronauts can control the flight from the keyboard The commands are 4-turn left, 6-turn right, 8-accelerate, 2 - slow down, 5 - exit. At the beginning the spacecraft has speed O miles per hour and it is positioned directly to Alpha Centauri (the angle 60 degrees). Command 8 increases the speed by 2 miles per hour, command 2 decreases the speed by 2 miles per hours. Command 4 increases the angle by 4 degrees, command 6 decreases the angle by 4 degrees Write a program that reads a command for a spacecraft and prints the current values of the speed and the angle An example of input: 884865 The corresponding output Speed: 2 mi/h, angle: 60 degrees Speed: 4 mi/h, angle: 60 degrees Speed: 4 mi/h, angle: 64 degrees Speed: 6 mi/h, angle: 64 degrees Speed: 6 mi/h, angle: 60 degrees Exit Procedural Programming Lab 6 You are to write and execute code for the following problems. When you are done, capture a screenshot of output and turn it in with the source code via Blackboard. Spacecraft You are to write a program for a spacecraft so that astronauts can control the flight from the keyboard The commands are 4-turn left, 6-turn right, 8-accelerate, 2 - slow down, 5 - exit. At the beginning the spacecraft has speed O miles per hour and it is positioned directly to Alpha Centauri (the angle 60 degrees). Command 8 increases the speed by 2 miles per hour, command 2 decreases the speed by 2 miles per hours. Command 4 increases the angle by 4 degrees, command 6 decreases the angle by 4 degrees Write a program that reads a command for a spacecraft and prints the current values of the speed and the angle An example of input: 884865 The corresponding output Speed: 2 mi/h, angle: 60 degrees Speed: 4 mi/h, angle: 60 degrees Speed: 4 mi/h, angle: 64 degrees Speed: 6 mi/h, angle: 64 degrees Speed: 6 mi/h, angle: 60 degrees Exit

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

Students also viewed these Databases questions

Question

7 How do you make interviews interesting?

Answered: 1 week ago

Question

please dont use chat gpt AI 2 3 0 .

Answered: 1 week ago

Question

Do you think physicians should have unions? Why or why not?

Answered: 1 week ago