Answered step by step
Verified Expert Solution
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 xcoord ycoord. 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 percent of charge for every units of distance that it travels rounded down to the nearest integer. Hint: You should use to calculate the distance moved Through experimentation you found that it generates 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 percent or if the temperature exceeds 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 and 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 and The temperature will be between and 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 or the temperature exceeds degrees or the user enters DONE.
New coordinates will be entered as floats in the format xcoordinate ycoordinate. New coordinates are absolute meaning they will always be entered as relative to the origin
Output
As with previous assessments, you should be using fstring rounding
Once the robot moves, you should output the distance moved rounded to decimal places and the new battery percentage rounded down to the nearest int in the format: OUTPUT distancemoved batterylevel
Once the simulation has finished, you should output:
The number of moves in the format: OUTPUT numberof moves
The distance from the origin on the and axis rounded to decimal places in the format: OUTPUT xdisplacement ydisplacement
The current temperature rounded down to the nearest int: OUTPUT temperature
The current battery level rounded down to nearest int: OUTPUT batterylevEl. Im struggling with this problem and how yo approach and solve pkease help
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started