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
Who is responsible for conducting a hazard assessment?
slava [35]

Answer:

The Employee

Explanation:

Because it is there responsibility

5 0
3 years ago
A glass tube is inserted into a flowing stream of water with one opening directed upstream and the other end vertical. If the wa
Furkat [3]

Answer:

h=0.46m

Explanation:

From the question we are told that:

Velocity of water V=3m/s

Height=?

Generally, the equation for Water Velocity is mathematically given by

V=\sqrt{2gh}

Therefore Height h is given as

h=\frac{v}{2g}

h=\frac{3^2}{2*9.81}

h=0.46m

5 0
3 years ago
Current density is given in cylindrical coordinates as J = −106z1.5az A/m2 in the region 0 ≤ rho ≤ 20 µm; for rho ≥ 20 µm, J = 0
Naily [24]

Question:

Current density is given in cylindrical coordinates as J = −10^6z^1.5az A/m² in the region 0 ≤ ρ ≤ 20 µm; for ρ ≥ 20 µm, J = 0.

(a) Find the total current crossing the surface z = 0.1 m in the az direction.

(b) If the charge velocity is 2 × 10^6 m/s at z = 0.1 m, find ρν there.

(c) If the volume charge density at z = 0.15 m is −2000 C/m3, find the charge velocity there.

Answer:

a. -39.8μA

b. -15.81mC/m³

c. 29.05m/s

Explanation:

Given

Density = J = −10^6z^1.5az A/m²

Region: 0 ≤ ρ ≤ 20 µm

ρ ≥ 20 µm

J = 0.

a. Total current is calculated by.

J * ½((ρ1)² - (ρ0)²) * 2 π * φdza.

Where J = Density = -10^6 * z^1.5

ρ1 = Upper bound of ρ = 20

ρ0 = Lower bound of ρ = 0

π = 22/7

φdza = 10^-6

z = 0.1

Total current

= -10^6 * z^1.5 * ½(20² - 0²) * 2 * 22/7 * 10^-6

= 10^6 * 0.1^1.5 * ½(20² - 0²) * 2 * 22/7 * 10^-6

= −39.7543477278310

= -39.8μA

b. Calculating velocity charge density at (ρv)

Density (J) = ρv * V

Where J = Density = -10^6 * z^1.5

V = 2 * 10^6

z = 0.1

Substitute the above values

-10^6 * 0.1 ^1.5 = ρv * 2 * 10^6

ρv = (-10^6 * 0.1^1.5)/(2 * 10^6)

ρv = -0.1^1.5/(2)

ρv = -0.015811388300841

ρv = -0.01581 --------- Approximated

ρv = -15.81mC/m³

c. Calculating Velocity

Velocity = J/V

Where Velocity Charge Density = -2000 C/m3

Where J = -10^6 * z^1.5

z = 0.15

J = -10^6 * 0.15^1.5

J = -58094.75019311125

Velocity = -58094.75019311125/-2000

Velocity = 29.047375096555625m/s

Velocity = 29.05m/s

8 0
3 years ago
A closed, rigid tank is lled with a gas modeled as an ideal gas, initially at 27°C and a gage pressure of 300 kPa. The gas is he
sergejj [24]

Answer:

T₂ =93.77  °C

Explanation:

Initial temperature ,T₁ =27°C= 273 +27 = 300 K

We know that

Absolute pressure = Gauge pressure + Atmospheric pressure

Initial pressure ,P₁ = 300+1=301 kPa

Final pressure  ,P₂= 367+1 = 368  kPa

Lets take  temperature=T₂

We know that ,If the volume of the gas is constant ,then we can say that

\dfrac{P_2}{P_1}=\dfrac{T_2}{T_1}

{T_2}=T_1\times \dfrac{P_2}{P_1}

Now by putting the values in the above equation we get

{T_2}=300\times \dfrac{368}{301}\ K

The temperature in  °C

T₂ = 366.77 - 273  °C

T₂ =93.77  °C

8 0
3 years ago
In the lab, a container of saturated soil had a mass of 113.27 g before it was placed in the oven and100.06 g after the soil had
kipiarov [429]

Answer:

  • Moisture/ water content w = 26%
  • Void ratio , e =  0.73

Explanation:

  • Initial mass of saturated soil w1 = mass of soil - weight of container

                                                 = 113.27 g - 49.31 g = 63.96 g

  • Final mass of soil after oven w2 = mass of soil - weight of container

                                                  = 100.06 g - 49.31 g = 50.75

Moisture /water content, w =   \frac{w1-w2}{w2} = \frac{63.96-50.75}{50.75} = 0.26 = 26%

Void ratio =  water content X specific gravity of solid

                  = 0.26 X 2.80 =0.728

5 0
3 years ago
Other questions:
  • What is the major drawback in nanocrystalline alloys? a)- high brittleness b)-low hardness c)-rapid grain growth upon heating d)
    9·1 answer
  • This is a new technology meant to reduce vehicle roll-overs A. Lane-departure warning B. Anti-lock brakes C. Inspection reports
    7·1 answer
  • Anyone have 11th grade engineering on odyssey ware?
    8·1 answer
  • How much heat (Btu) is prod uced by a 150-W light bulb that is on for 20-hours?
    14·1 answer
  • Under conditions for which the same roojm temperature is mainteined bt a heating or cooling system, it is not uncommon for a per
    10·1 answer
  • Write an application named EnterUppercaseLetters that asks the user to type an uppercase letter from the keyboard. If the charac
    8·1 answer
  • Determine the total condensation rate of water vapor onto the front surface of a vertical plate that is 10 mm high and 1 m in th
    8·2 answers
  • Please help! timed test. This about electrical control. Please be serious.
    15·1 answer
  • 10. What refrigerant is no longer manufactured in the<br> United States?
    5·2 answers
  • At the beginning of last year, tarind corporation budgeted $1,000,000 of fixed manufacturing overhead and chose a denominator le
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!