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
A 1.5-m-long aluminum rod must not stretch more than 1 mm and the normal stress must not exceed 40 MPa when the rod is subjected
Pavlova-9 [17]

Answer:

the required diameter of the rod is 9.77 mm

Explanation:

Given:

Length = 1.5 m

Tension(P) = 3 kN = 3 × 10³ N

Maximum allowable stress(S) = 40 MPa = 40 × 10⁶ Pa

E = 70 GPa = 70 × 10⁹ Pa

δ = 1 mm = 1 × 10⁻³ m

The required diameter(d)  = ?

a) for stress

The stress equation is given by:

S = \frac{P}{A}

A is the area = πd²/4 = (3.14 × d²)/4

S = \frac{P}{(\frac{3.14*d^{2} }{4}) }

S = \frac{4P}{{3.14*d^{2} } }

3.14*S*{d^{2}} = {4P}

{d^{2}} =\frac{4P}{3.14*S}

d=  \sqrt{\frac{4P}{3.14*S} }

Substituting the values, we get

d=  \sqrt{\frac{4*3*10^{3} }{3.14*40*10^{6} } }

d=  \sqrt{\frac{12000 }{125600000  } }

d=  \sqrt{9.55*10^{-5}  }

d = (9.77 × 10⁻³) m

d = 9.77 mm

b) for deformation

δ = (P×L) / (A×E)

A = (P×L) / (E×δ) = (3000 × 1.5) / (1 × 10⁻³ × 70 × 10⁹) = 0.000063

d² = (4 × A) / π = (0.000063 × 4) / 3.14

d² = 0.0000819

d = 9.05 × 10⁻³ m = 9.05 mm

We use the larger value of diameter = 9.77 mm

3 0
3 years ago
Speed limit signs are classified as
luda_lava [24]

Answer:

B. Regulatory signs

Explanation:

traffic rules

5 0
3 years ago
Read 2 more answers
. The job of applications engineer for which Maria was applying requires (a) excellent technical skills with respect to mechanic
Hitman42 [59]

Answer:

  1. Tell us about your self
  2. Are your confident that you are the right candidate for this position
  3. why should i hire you
  4. Do you like working under supervision
  5. How do you like to work ( in a group or individually )
  6. What is your ultimate workplace goal
  7. what are your future plans
  8. What do you expect from the Organization when given the job
  9. Do you like taking on critical problems
  10. How long can you work in this position

Explanation:

For a job of applications engineer which require excellent technical skills, commitment  to working , ability to deal well and confidently with customers a willingness to travel and very intelligent and well-balanced personality.

The ten questions you should ask Maria to determine if she is qualified for the job are :

  1. Tell us about your self ( functions you have )
  2. Are your confident that you are the right candidate for this position
  3. why should i hire you
  4. Do you like working under supervision
  5. How do you like to work ( in a group or individually )
  6. What is your ultimate workplace goal
  7. what are your future plans
  8. What do you expect from the Organization when given the job
  9. Do you like taking on critical problems
  10. How long can you work in this position
5 0
3 years ago
You are given a body with no body forces and told that the stress state is given as: ⎡ ⎣ 3αx 5βx2 + αy γz3 5βx2 + αy βx2 0 γz3 0
Lady bird [3.3K]

Answer:

This doesn't represent an equilibrium state of stress

Explanation:

∝ = 1 , β = 1 ,  y = 1

x = 0 , y = 0 , z = 0 ( body forces given as 0 )

Attached is the detailed solution is and also the conditions for equilibrium

for a stress state to be equilibrium all three conditions has to meet the equilibrum condition as explained in the attached solution

5 0
4 years ago
Exercise 19
musickatia [10]
Uhh idk this can u mabye look it up
6 0
4 years ago
Other questions:
  • Air flows steadily through a turbine that produces 3.5x 105 ft-lbf/s of work. Using the data below at the inlet and outlet, wher
    14·1 answer
  • Amorphous material is characterized by by a) organized crystalline structure; b) high hardness and ductility c)the chaotic arran
    6·1 answer
  • (Tacoma Bridge Failure) Are There Relevant Ethical Issues Or Just 20-20 Hindsight?
    10·1 answer
  • Design an op amp circuit to average the input of six sensors used to measure temperature in restaurant griddles for a large fast
    7·1 answer
  • Suppliers(sid: integer, sname: string, address: string)
    9·1 answer
  • Question: What's something you really resent paying for?
    7·2 answers
  • Is there anyone who can help me with welding?
    12·1 answer
  • A storage tank is purged continuously with a stream of nitrogen. The purgestream leaving the tank is saturated with the product
    11·1 answer
  • Please help will mark brainliest
    10·1 answer
  • What’s the answer to this I don’t understand
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!