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 steam turbine receives 8 kg/s of steam at 9 MPa, 650 C and 60 m/s (pressure, temperature and velocity). It discharges liquid-v
adelina 88 [10]

Answer:

The power produced by the turbine is 23309.1856 kW

Explanation:

h₁ = 3755.39

s₁ = 7.0955

s₂ = sf + x₂sfg  =

Interpolating fot the pressure at 3.25 bar gives;

570.935 +(3.25 - 3.2)/(3.3 - 3.2)*(575.500 - 570.935) = 573.2175

2156.92 +(3.25 - 3.2)/(3.3 - 3.2)*(2153.77- 2156.92) = 2155.345

h₂ = 573.2175 + 0.94*2155.345 = 2599.2418 kJ/kg

Power output of the turbine formula =

Q - \dot{W } = \dot{m}\left [ \left (h_{2}-h_{1}  \right )+\dfrac{v_{2}^{2}- v_{1}^{2}}{2} + g(z_{2}-z_{1})\right ]

Which gives;

560 - \dot{W } = 8\left [ \left (2599.2418-3755.39  \right )+\dfrac{15^{2}- 60^{2}}{2} \right ]

= -8*((2599.2418 - 3755.39)+(15^2 - 60^2)/2 ) = -22749.1856

- \dot{W } = -22749.1856 - 560 = -23309.1856 kJ

\dot{W } = 23309.1856 kJ

Power produced by the turbine = Work done per second = 23309.1856 kW.

5 0
3 years ago
An engineer is working with archeologists to create a realistic Roman village in a museum. The plan for a balance in a marketpla
NeTakaya

Answer:

The minimum volume requirement for the granite stones is 1543.64 cm³

Explanation:

1 granite stone weighs 10 denarium

100 granted stones will weigh 1000 denarium

1 denarium = 3.396g

1000 denarium = 3396g.

But we're told that 20% of material is lost during the making of these stones.

This means the mass calculated represents 80% of the original mass requirement, m.

80% of m = 3396

m = 3396/0.8 = 4425 g

This mass represents the minimum mass requirement for making the stones.

To now obtain the corresponding minimum volume requirement

Density = mass/volume

Volume = mass/density = 4425/2.75 = 1543.64 cm³

Hope this helps!!!

3 0
3 years ago
A Si sample contains 1016 cm-3 In acceptor atoms and a certain number of shallow donors, the In acceptor level is 0.16 eV above
creativ13 [48]

Answer:

6.5 × 10¹⁵/ cm³

Explanation:

Thinking process:

The relation N_{o} = N_{i} * \frac{E_{f}-E_{i}  }{KT}

With the expression Ef - Ei = 0.36 × 1.6 × 10⁻¹⁹

and ni = 1.5 × 10¹⁰

Temperature, T = 300 K

K = 1.38 × 10⁻²³

This generates N₀ = 1.654 × 10¹⁶ per cube

Now, there are 10¹⁶ per cubic centimeter

Hence, N_{d}  = 1.65*10^{16}  - 10^{16} \\           = 6.5 * 10^{15} per cm cube

5 0
3 years ago
Read 2 more answers
100 kg of R-134a at 200 kPa are contained in a piston–cylinder device whose volume is 12.322 m3. The piston is now moved until t
LekaFEV [45]

Answer:

T=151 K, U=-1.848*10^6J

Explanation:

The given process occurs when the pressure is constant. Given gas follows the Ideal Gas Law:

 pV=nRT

For the given scenario, we operate with the amount of the gas- n- calculated in moles. To find n, we use molar mass: M=102 g/mol.  

Using the given mass m, molar mass M, we can get the following equation:  

 pV=mRT/M

To calculate change in the internal energy, we need to know initial and final temperatures. We can calculate both temperatures as:

T=pVM/(Rm); so initial T=302.61K and final T=151.289K

 

Now we can calculate change of U:

U=3/2 mRT/M using T- difference in temperatures

 U=-1.848*10^6 J

Note, that the energy was taken away from the system.  

5 0
3 years ago
The __________________ refers to the main screen of the computer.
Sedbober [7]

Answer:

<em>D</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em>

Explain:

<em>Desktop refers to the main screen of the computer. It is the first screen you see after logging in. The desktop’s appearance can vary widely because it is highly customizable, but generally desktops will feature a large image, icons, and a taskbar(covered later on this page).</em>

4 0
2 years ago
Other questions:
  • Compute the estimated actual endurance limit for SAE 4130 WQT 1300 steel bar with a rectangular cross section of 20.0 mm by 60 m
    11·1 answer
  • Question 54 (1 point)
    11·2 answers
  • Barry wants to convert mechanical energy into electric energy. What can he use?
    5·2 answers
  • Consider the equation y = 10^(4x). Which of the following statements is true?
    9·1 answer
  • 30 points have a good day
    11·1 answer
  • ?Why the efficiency of Class A amplifier is very poor​
    11·1 answer
  • PLZZZZZ HELP
    7·2 answers
  • Cody’s car accelerates from 0m/s to 45 m/s northward in 15 seconds. What is the acceleration of the car
    14·1 answer
  • CNG is a readily available alternative to _________.
    9·1 answer
  • How pine are processed ????
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!