Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem As you have seen thus far, programming allows us to model systems of varying complexity. This week, we will be be writing a program

Problem
As you have seen thus far, programming allows us to model systems of varying complexity. This week, we will be be writing a program to model a robot while keeping track of diagnostic parameters.
Our robot is capable of receiving inputs as coordinates that it should move to in the format x_coord y_coord. However, as it moves, it loses charge on its lithium ion battery, which generates heat as the battery depletes. One of the robot's engineers was able to determine that it looses 1 percent of charge for every 2 units of distance that it travels rounded down to the nearest integer. (Hint: You should use (newx-oldx)2+(newy-oldy)22 to calculate the distance moved). Through experimentation you found that it generates 5 degrees of heat per percent of battery discharged.
Due to a desire to keep the robot operating within safe parameters, if the battery dips below 10 percent or if the temperature exceeds 125 degrees, the robot should shut down and stop accepting input. Once it shuts down you should report the number of moves that the robot made, the distance from the origin along both the x and y axis, the current temperature, and current battery level.
Input
In order to simulate a variety of conditions, you will accept the initial battery level and the initial temperature as inputs. The battery level entered will be between 0 and 100. The temperature will be between -50 and 150. You can assume that the robot will always start at the origin.
The initial battery level and initial temperature will be entered (and should remain) as integers.
Your program should accept new coordinates until either the battery is at or below 10% or the temperature exceeds 125 degrees or the user enters DONE.
New coordinates will be entered as floats in the format x_coordinate y_coordinate. New coordinates are absolute (meaning they will always be entered as relative to the origin).
Output
As with previous assessments, you should be using f-string rounding
Once the robot moves, you should output the distance moved rounded to 2 decimal places and the new battery percentage (rounded down to the nearest int) in the format: OUTPUT distance_moved battery_level
1
Once the simulation has finished, you should output:
The number of moves in the format: OUTPUT number_of moves
The distance from the origin on the x and y axis rounded to 2 decimal places in the format: OUTPUT x_displacement y_displacement
The current temperature (rounded down to the nearest int): OUTPUT temperature
The current battery level (rounded down to nearest int): OUTPUT battery_levEl. Im struggling with this problem and how yo approach and solve pkease help
image text in transcribed

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

Database Systems For Advanced Applications 9th International Conference Dasfaa 2004 Jeju Island Korea March 2004 Proceedings Lncs 2973

Authors: YoonJoon Lee ,Jianzhong Li ,Kyu-Young Whang

2004th Edition

3540210474, 978-3540210474

More Books

Students also viewed these Databases questions

Question

Distinguish between harmony, harmonization and standardization.

Answered: 1 week ago

Question

2. Describe how technology can impact intercultural interaction.

Answered: 1 week ago

Question

7. Define cultural space.

Answered: 1 week ago