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
Describe the engineering design process in your own words.
MrMuchimi

Answer:

Explanation:

8 0
3 years ago
Read 2 more answers
7.35 and 7.36 For the beam and loading shown, (a) draw the shear and bending-moment diagrams, (b) determine the maximum absolute
Crank

Maximum absolute values of the shear = 28 KN

Maximum absolute values of bending moment = 5.7 KN.m

<h3>How to draw Shear Force and Bending Moment Diagram?</h3>

A) We can see the beam loaded in the first image attached.

For the shear diagram, let us calculate the shear from point load to point load.

From A to C, summing vertical to zero gives; ∑fy = 0: -20 - V = 0

V = -20 KN

From C to D, summing vertical to zero gives; ∑fy = 0: -20 + 48 - V = 0

V = 28 KN

From D to E, summing vertical to zero gives; ∑fy = 0: -20 + 48 - 20 - V = 0

V = 8 KN

From E to B, summing vertical to zero gives; ∑fy = 0: -20 + 48 - 20 - 20 - V = 0

V = -12 KN

For the bending moment diagram, let us calculate the bending moment from point load to point load.

At point A, the bending moment would be zero. Thus, M_A = 0 KN.m

At point C, taking moment about point C and equating to zero gives;

M_C = 0. Thus; 20(0.225) + M = 0

M = -4.5 KN.m

At point D, taking moment about point D and equating to zero gives;

M_D = 0. Thus; 20(0.525) - 48(0.3) + M = 0

M = 3.9 KN.m

At point E, taking moment about point E and equating to zero gives;

M_D = 0. Thus; 20(0.75) - 48(0.525) + 20(0.225) + M = 0

M = 5.7 KN.m

At point B, taking moment about point E and equating to zero gives;

M_E = 0. Thus; 20(1.05) - 48(0.825) + 20(0.525) + (20 * 0.3) + M = 0

M = 2.1 KN.m

2) From the attached diagrams, we can deduce that;

Maximum absolute values of the shear = 28 KN

Maximum absolute values of bending moment = 5.7 KN.m

Read more about shear force & bending moment diagram at; brainly.com/question/14834487

#SPJ1

4 0
2 years ago
Additional scals apply to the
REY [17]
Location of the class depends on satiation
4 0
2 years ago
One kilogram of water fills a 150-L rigid container at an initial pressure of 2 MPa. The container is then cooled to 40∘C. Deter
lukranit [14]

The pressure of water is 7.3851 kPa

<u>Explanation:</u>

Given data,

V = 150×10^{-3} m^{3}

m = 1 Kg

P_{1} = 2 MPa

T_{2}  = 40°C

The waters specific volume is calculated:

v_{1} = V/m

Here, the waters specific volume at initial condition is v_{1}, the containers volume is V, waters mass is m.

v_{1} = 150×10^{-3} m^{3}/1

v_{1} = 0.15 m^{3}/ Kg

The temperature from super heated water tables used in interpolation method between the lower and upper limit for the specific volume corresponds 0.15 m^{3}/ Kg and 0.13 m^{3}/ Kg.

T_{1}= 350+(400-350) \frac{0.15-0.13}{0.1522-0.1386}

T_{1} = 395.17°C

Hence, the initial temperature is 395.17°C.

The volume is constant in the rigid container.

v_{2} = v_{1}= 0.15 m^{3}/ Kg

In saturated water labels for T_{2}  = 40°C.

v_{f} = 0.001008 m^{3}/ Kg

v_{g} = 19.515 m^{3}/ Kg

The final state is two phase region v_{f} < v_{2} < v_{g}.

In saturated water labels for T_{2}  = 40°C.

P_{2} = P_{Sat} = 7.3851 kPa

P_{2} = 7.3851 kPa

7 0
3 years ago
A mixing basin in a sewage filtration plant is stirred by a mechanical agitator with a power input/WF L T=. Other parameters de
MakcuM [25]

Answer: π= G[√(u.V/W)]

STEP 1

Given parameters:

Power Input W= FL/T,

Absolute Viscosity u= FT/L²

Basin volume V= V/L³

Velocity gradient G= V/L³

STEP 2

We start by expressing the velocity gradient G as a function of W, u, V

G= G(W,u,V)

To get the pii terms, we use the dimension number formula n=k - r

where n and k are natural numbers representing number of fundamental dimensions and variable present respectively.

n= 4-3=1

STEP 3:

We expressed the pii terms as

π= G.W^a.u^b.V^c

The three fundamental F L T

We can write as

Fⁿ.Lⁿ.Tⁿ= 1/T. (FL/T)^a.(FT/L²)^b.(L³)

Using the exponential rule and by comparing coefficient on both sides;

Fⁿ.Lⁿ.Tⁿ= F^a+b. L^a-2b+3c. T^-a+b-1

Fⁿ= F^a+b = a+b= 0..............I

Lⁿ= L^a-2b+3c=0 = a-2b+3c=0...........ii

Tⁿ=L^-a+b-1=0. -a+b-1=0............iii

From the above equations we have,

a+b =0: b=-a...........iv

putting eq. iv into iii , we have

-a-a-1=0: -2a-1=0: a= -1/2

substituting the above value of a into eq iv, we have

b= 1/2

substituting the value of b above into eq 2, we have,

-1/2-2(1/2)+3c=0

c=1/2.

Lastly, from the pii terms given above we can obtain dimensionless relationship,

π=G(W^-1/2.u^1/2.V^1/2)

We can write this as

π= G[ √1/W.√u. √1/2] = G[(√u.V/√W)] or G[√(u.V/W)].... final answer.

5 0
3 years ago
Other questions:
  • Line layout is also called ......​
    5·1 answer
  • A freshly annealed glass containing flaws of maximum length of 0.1 microns breaks under a tensile stress of 120 MPa. If a sample
    13·1 answer
  • ). A company periodically tests its product for tread wear under simulated conditions. Thirty random samples, each containing 5
    11·1 answer
  • What is an air mass?​
    5·2 answers
  • Which type of finish is absorbed into the wood?
    7·1 answer
  • Add my sc please?.<br><br> kindacracked
    12·2 answers
  • Is an ideal way for a high school student to see what an engineer does on a typical day but does not provide a hands-on experien
    9·2 answers
  • Safety-in engineering as with everything else is all about trying to maximize or create the hazards involved with what you are d
    6·2 answers
  • A. Briefly describe the microstructural difference between spheroidite and tempered martensite. Explain why tempered martensite
    14·1 answer
  • What are the horizontal structures beneath a slab that help transfer the load from the slab to the columns?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!