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
drek231 [11]
3 years ago
9

What is the value of the magicPowers variable after executing the following code snippet? String magicPowers = ""; int experienc

eLevel = 9; if (experienceLevel > 10) { magicPowers = magicPowers + "Golden sword "; } if (experienceLevel > 8) { magicPowers = magicPowers + "Shining lantern "; } if (experienceLevel > 2) { magicPowers = magicPowers + "Magic beans "; }

Engineering
1 answer:
Evgen [1.6K]3 years ago
5 0

Answer:

Shining lantern Magic beans                

Explanation:

I will explain the code line by line.

The first statement contains a string type variable magicPowers and second statement has an int type variable experienceLevel which is initialized by value 9.

Nested if statement are used and lets see which of those statements execute.

The first if statement checks if the value of experienceLevel is greater than 10. This statement evaluates to false because the value of experienceLevel is set to 9. Then the program control moves to the next if statement.

The second if statement checks if the value of experienceLevel is greater than 8. This if condition evaluates to true because the value of experienceLevel  is 9. So this if statement is executed which contains the statement magicPowers = magicPowers + "Shining lantern "; . This means magicPowers stores the string Shining lantern.

The third if statement checks if the value of experienceLevel  is greater than 2. As the value of experienceLevel  is 9 so this condition also evaluates to true which means the statement magicPowers = magicPowers + "Magic beans "; is executed. This statement means magicPowers stores the string Magic Beans

You can use a print statement to display the output on the screen as:

System.out.print(magicPowers);

Output:

Shining lantern Magic beans        

The program along with the output is attached as a screenshot.

You might be interested in
Anything you want to do in Hootsuite can be found in the ________, with the main workspace in the _________?
Thepotemich [5.8K]

Answer:

Anything you want to do in Hootsuite can be found in the ___ Sidebar_____, with the main workspace in the ___center______

Sidebar; center

Explanation:

The main workspace of the Hootsuite is located in the center.  The sidebar is where the core access to the Hootsuite functionality, like Streams, Inbox, Planner, Analytics, Publisher, and the App Directory, is obtained.  Hootsuite is a media management platform for curating content, scheduling posts, managing team members, and measuring performances.

5 0
3 years ago
A motorist is driving his car at 60km/hr when he observes that a traffic light 250m ahead turns red. The traffic light is
Alecsey [184]

Explanation:

Okay soo-

Given-

u = 60 km/hr = 60×1000/3600=50/3 m/s

t = 20 s

s = 250 m

a = ?

v = ?

Solution -

Here, acceleration is uniform.

(a) According to 2nd kinematics equation,

s = ut + ½at^2

250 = 50/3 ×20 + 0.5×a×20×20

250-1000/3=200a

(750-1000)/3=200a

a = -250/(3×200)

a = -5/12

a = 0.4167 m/s^2

The required uniform acceleration of the car is 0.4167 m/s^2.

(b) According to 1st kinematics equation

v = u + at

v = 50/3 + (-5/12)×20

v = 50/3-25/3

v = 25/3

v = 8.33 m/s

The speed of the car as it passes the traffic light is 8.33 m/s.

Good luck!

5 0
3 years ago
A ½-hp motor requires 120 volts. What amperage is required?
Zolol [24]

Answer:

  3.11 A

Explanation:

Use the given relations between power, horsepower, voltage, and current to find the current requirement for the motor.

  P = hp(745.7 W) = (1/2)(745.7 W) = 372.85 W

  I = P/V = (372.85 W)/(120 V) = 3.1071 A

The amperage required is about 3.11 A.

5 0
3 years ago
The acceleration of a particle as it moves along a straight line is given
BARSIC [14]

Answer:

V_t=6 = 32 m/s

Explanation:

The origin is at point 0 with the positive motion to the right  

The instantaneous acceleration is change of velocity measured at infinitesimal interval of time, so the expression for instantaneous acceleration is:  

a=dv/dt

From here we can express dv as:

dv = a dt

Replace a by 2t — 1

dv = (2t — 1) dt

Integrate both sides of equation  

\int\limits^v_a  {2t-1} \, dv

v=t

a=t_0

putting these value in integral

<em>v-v_0=(t^2-t)-(t_0^2-t_0)</em>

We know that v_0 = 2 at t_0 = 0, so we'll replace t_0 and v_0 by their values

v — 2 = (t^2 — t) — (0^2 — 0)

From here we can write the expression for v as:  

v_t=6=6^2-6+2                             (1)  

So the velocity at t = 6 s is:

v_t=6 = 32 m/s

V_t=6 = 32 m/s

In order to determine the total distance travelled, we must check how maw times the particle has changed its direction, i.e. how many times its speed was equal to zero  

To do that, we'll just replace v by 0 in expression (1)

0 = t^2 — t + 2

The roots of the quadratic equation are:

t_1/2=1±  √(1^2-4*2*1)/2

Since 1^2-4*2*1 < 0, the quadratic equation have no real roots, so we can say that the velocity is always positive, i.e. to the right  

Now that we have all the details, we can correctly draw the path of the particle  

We can see from the sketch that the total distance traveled is:  

s^T=Δs_0-1

s^T=| s_1 - s_0 |

Replace s_0 by its value  

s^T=| s_1 - 1 |                                        (2)  

In order to determine the position of particle at t = 6 s, we'll need to determine the expression for s as function of time  

Since we have already wrote expression for v as function of time (step 2), we'll use expression  to get the expression for s

v= ds/dt  

Multiply both sides of equation by dt

v dt = ds

Replace v by expression (1)

(t^2 — t + 2) dt = ds

Integrate both sides of equation  

\int\limits^t_b {x} \, dx

t=s

b=(s=0)

x=(t^2 — t + 2)

dx=ds

putting these value in integral

(t^3/3-t^2/2+t)-(t_0^3/3-t_0^2/2+t_0)= s-s_0

Since s = 1 m at t = 0, and we want to determine the position s at t = 6, we'll replace so by 1, t_0 by 0 and t by 6  

(6^3/3-6^2/2+6)-(0^3/3-0^2/2+0)=s_t=6-1

4 0
4 years ago
Which of the following waste characteristic is considered to be hazardous:
Lynna [10]

Answer:

D) all of the above

Explanation:

8 0
4 years ago
Other questions:
  • Which of the following color schemes is composed of hues next to eachother on the color wheel ?
    7·1 answer
  • An integrated circuit is a set of microscopic electronic circuits etched onto a thin slice of ________ material such as silicon.
    7·1 answer
  • Which of the following identifies a criterion needed to become a civil engineer?
    15·1 answer
  • At the grocery store you place a pumpkin with a mass of 12.5 lb on the produce spring scale. The spring in the scale operates su
    5·1 answer
  • Which among the four that doesn't use an elbow in wiring installation a.EMT b. CPC c.PVC d.RSC<br>​
    8·1 answer
  • What are the main subsystem of GSM<br> network​
    15·1 answer
  • Training is a way for employers to provide ____ to enable employees to protect themselves and others from injuries.
    9·2 answers
  • The standard weight of copper tubing used most frequently in the heating and air-conditioning industry is
    12·1 answer
  • 10 tasks and 5 exercises. How many ways are there to build the test?
    14·1 answer
  • An o ring intended for use in a hydraulic system using MIL-H-5606 (mineral base) fluid will be marked with
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!