1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
snow_tiger [21]
3 years ago
8

A certain robot can perform only 4 types of movement. It can move either up or down or left or right. These movements are repres

ented by ’U’, ’D’, ’L’, ’R’. Assume all these movements to be of unit distance. Write a function named theRoundTrip that takes all the movements the robot made in a day as input and output True of bool type if the robot returned to its starting position after its journey. Otherwise, return False. If the input is bad print the message "bad input".
Engineering
1 answer:
Olegator [25]3 years ago
8 0

Answer:

def theRoundTrip(movement):

   x=0

   y=0

   for i in movement:

       if i not in ["U","L","D","R"]:

           print("bad input")

           return

       if i=="U":

           y+=1

       if i=="L":

           x-=1

       if i=="D":

           y-=1

       if i=="R":

           x+=1

   return x==0 and y==0

You might be interested in
Gtjffs
grandymaker [24]

the required documents is 3000

4 0
2 years ago
A hypothetical metal alloy has a grain diameter of 2.4 × 10−2 mm. After a heat treatment at 575°C for 500 min, the grain diamete
Alex

Answer:

The time required is 10.078 hours or 605 min

Explanation:

The formula to apply here is ;

K=(d²-d²₀ )/t

where t is time in hours

d is grain diameter to be achieved after heating in mm

d₀ is the grain diameter before heating in mm

Given

d=5.5 × 10^-2 mm

d₀=2.4 × 10^-2 mm

t₁= 500 min = 500/60 =25/3 hrs

t₂=?

n=2.2

First find K

K=(d²-d²₀ )/t₁

K={ (5.1 × 10^-2 mm)²-(2.4 × 10−2 mm)² }/ 25/3

K=(0.051²-0.024²) ÷25/2

K=0.000243 mm²/h

Re-arrange equation for K ,to get the equation for d as;

d=√(d₀²+ Kt)  where now t=t₂

d=\sqrt{0.024^2+0.000243*t} \\\\0.055=\sqrt{0.024^2+0.000243t} \\\\0.055^2=0.024^2+0.000243t\\\\0.055^2-0.024^2=0.000243t\\\\0.002449=0.000243t\\\\0.002449/0.000243=t\\\\10.078=t\\\\t=605min

4 0
3 years ago
A vector AP is rotated about the Z-axis by 60 degrees and is subsequently rotated about X-axis by 30 degrees. Give the rotation
Musya8 [376]

Answer:

R = \left[\begin{array}{ccc}1&0&0\\0&cos30&-sin30\\0&sin30&cos30\end{array}\right]\left[\begin{array}{ccc}cos 60&-sin60&0\\sin60&cos60&60\0&0&1\end{array}\right]

Explanation:

The mappings always involve a translation and a rotation of the matrix. Therefore, the rotation matrix will be given by:

Let \theta and \alpha be the the angles 60⁰ and 30⁰ respectively

that is \theta = 60⁰ and

\alpha = 30⁰

The matrix is given by the following expression:

\left[\begin{array}{ccc}1&0&0\\0&cos30&-sin30\\0&sin30&cos30\end{array}\right]\left[\begin{array}{ccc}cos 60&-sin60&0\\sin60&cos60&60\0&0&1\end{array}\right]

The angles can be evaluated and left in the surd form.

4 0
2 years ago
Use the scoring system described to calculate the alignment score for These are two lines of 14 letters aligned with each other.
PtichkaEL [24]

Answer:

do good

Explanation:

get that money

7 0
3 years ago
Rsidential Solar Solution:a. A type of photovoltaic solar panel manufactured in China receives a rating of 250W. The rating proc
aksik [14]

Answer:

a) \eta = 13.455\%, b) E_{day} = 812.716\,kJ, c) C_{month. total} = 19.505\, USD, d) t = 40.588\,years

Explanation:

a) The area of the solar panel is:

A = (20\,ft^{2})\cdot (\frac{0.3048\,m}{1\,ft} )^{2}

A = 1.858\,m^{2}

The energy potential is determined herein:

\dot E_{o} = (1000\,\frac{W}{m^{2}} )\cdot (1.858\,m^{2})

\dot E_{o} = 1858\,W

The efficiency of the solar panel is:

\eta = \frac{\dot E}{\dot E_{o}}\times 100\%

\eta = \frac{250\,W}{1858\,W}\times 100\%

\eta = 13.455\%

b) The energy generated by the solar panel is presented below:

E_{day} = (0.135)\cdot (150\,\frac{W}{m^{2}} )\cdot (20\,ft^{2})\cdot \left(\frac{0.3048\,m}{1\,ft} \right)^{2}\cdot (6\,h)\cdot (\frac{3600\,s}{1\,h} )\cdot (\frac{1\,kJ}{1000\,J} )

E_{day} = 812.716\,kJ

c) The energy generated per month and per panel is:

E_{month} = 30\cdot E_{day}

E_{month} = 30 \cdot (812.716\,kJ)\cdot \left(\frac{1\,kWh}{3600\,kJ}  \right)

E_{month} = 6.773\,kWh

Monthly energy savings due to the use of 18 panels are:

C_{month, total} = 18\cdot E_{month}\cdot c

C_{month, total} = 18\cdot (6.773\,kWh)\cdot (\frac{0.16\,USD}{1\,kWh} )

C_{month. total} = 19.505\, USD

d) The payback of the solar energy system is:

t = \frac{9500\,USD}{12\cdot (19.505\,USD)}

t = 40.588\,years

6 0
3 years ago
Other questions:
  • Define a public static method named s2f that takes two String arguments, the name of a file and some text. The method creates th
    5·1 answer
  • Atmospheric pressure is measured to be 14.769 psia. a. What would be the equivalent reading of a water barometer (inches of H20)
    11·1 answer
  • A heat engine does 210 J of work per cycle while exhausting 440 J of waste heat. Part A What is the engine's thermal efficiency?
    6·1 answer
  • A long bone is subjected to a torsion test. Assume that the inner diameter is 0.375 in. and the outer diameter is 1.25 in., both
    14·1 answer
  • Why Your first project as the new web designer at Smart Design is to increase web traffic to help boost web orders. Before you b
    6·1 answer
  • A flow of 12 m/s passes through a 6 m wide, 2 m deep rectangular channel with a bed slope of 0. 001. If the mean velocity of flo
    12·1 answer
  • The insulator is the connection between the grounded circuit conductor and the equipment grounding conductor at the service.
    15·1 answer
  • I really need a good grade please help
    13·1 answer
  • Please help me with this. Picture
    10·1 answer
  • Using your knowledge of how an ATM is used, develop a set of use cases that could serve as a basis for understanding the require
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!