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
Consider an area-source box model for air pollution above a peninsula of land. The length of the box is 15 km, its width is 80 k
In-s [12.5K]

Consider an area-source box model for air pollution above a peninsula of land. The length of the box is 15 km, its width is 80 km, and a radiation inversion restricts mixing to 15 m. Wind is blowing clean air into the long dimension of the box at 0.5 m/s. On average, there are 250,000 vehicles on the road, each being driven 40 km in 2 hours and each emitting 4 g/km of CO.

Required:

a. Estimate the steady-state concentration of CO in the air. Should the city be designated as "nonattainment" (i.e., steady-state concentration is over the NAAQS standard)?

b. Find the average rate of CO emissions during this two-hour period.

c. If the windspeed is zero, use the formula to derive relationship between CO and time and use it to find the CO over the peninsula at 6pmConsider an area-source box model for air pollution above a peninsula of land. The length of the box is 15 km, its width is 80 km, and a radiation inversion restricts mixing to 15 m. Wind is blowing clean air into the long dimension of the box at 0.5 m/s. On average, there are 250,000 vehicles on the road, each being driven 40 km in 2 hours and each emitting 4 g/km of CO.

Required:

a. Estimate the steady-state concentration of CO in the air. Should the city be designated as "nonattainment" (i.e., steady-state concentration is over the NAAQS standard)?

b. Find the average rate of CO emissions during this two-hour period.

c. If the windspeed is zero, use the formula to derive relationship between CO and time and use it to find the CO over the peninsula at 6pmConsider an area-source box model for air pollution above a peninsula of land. The length of the box is 15 km, its width is 80 km, and a radiation inversion restricts mixing to 15 m. Wind is blowing clean air into the long dimension of the box at 0.5 m/s. On average, there are 250,000 vehicles on the road, each being driven 40 km in 2 hours and each emitting 4 g/km of CO.

Required:

a. Estimate the steady-state concentration of CO in the air. Should the city be designated as "nonattainment" (i.e., steady-state concentration is over the NAAQS standard)?

b. Find the average rate of CO emissions during this two-hour period.

c. If the windspeed is zero, use the formula to derive relationship between CO and time and use it to find the CO over the peninsula at 6pm

<em><u>p</u></em><em><u>lease</u></em><em><u> mark</u></em><em><u> me</u></em><em><u> as</u></em><em><u> brainliest</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em>

<em><u>f</u></em><em><u>ollow</u></em><em><u> me</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>,</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em>

3 0
3 years ago
The fracture strength of glass may be increased by etching away a thin surface layer. It is believed that the etching may alter
Korvikt [17]

Answer:

the ratio of the etched to the original crack tip radius is 30.24

Explanation:

Given the data in the question;

we determine the initial fracture stress using the following expression;

(σf)₁ = 2(σ₀)₁ [ α₁/(p_t)₁ ]^{1/2 ----- let this be equation 1

where; (σ₀)₁ is the initial fracture strength

(p_t)₁ is the original crack tip radius

α₁ is the original crack length.

first, we determine the final crack length;

α₂ = α₁ - 16% of α₁

α₂ = α₁ - ( 0.16 × α₁)

α₂ = α₁ - 0.16α₁

α₂ = 0.84α₁

next, we calculate the final fracture stress;

the fracture strength is increased by a factor of 6;

(σ₀)₂ = 6( σ₀ )₁

Now, expression for the final fracture stress

(σf)₂ = 2(σ₀)₂ [ α₂/(p_t)₂ ]^{1/2 ------- let this be equation 2

where (p_t)₂ is the etched crack tip radius

value of fracture stress of glass is constant

Now, we substitute 2(σ₀)₁ [ α₁/(p_t)₁ ]^{1/2 from equation for (σf)₂  in equation 2.

0.84α₁ for α₂.

6( σ₀ )₁ for (σ₀)₂.

∴

2(σ₀)₁ [ α₁/(p_t)₁ ]^{1/2  = 2(6( σ₀ )₁) [ 0.84α₁/(p_t)₂ ]^{1/2  

divide both sides by 2(σ₀)₁

[ α₁/(p_t)₁ ]^{1/2  =  6 [ 0.84α₁/(p_t)₂ ]^{1/2

[ 1/(p_t)₁ ]^{1/2  =  6 [ 0.84/(p_t)₂ ]^{1/2

[ 1/(p_t)₁ ]  =  36 [ 0.84/(p_t)₂ ]

1 / (p_t)₁ = 30.24 / (p_t)₂

(p_t)₂ = 30.24(p_t)₁

(p_t)₂/(p_t)₁ = 30.24

Therefore, the ratio of the etched to the original crack tip radius is 30.24

6 0
3 years ago
Π/4 = 1 - 1/3 + 1/5 - 1/7 + 1/9 ...
leva [86]

Answer: Pi= 4 - 4/3 + 4/5 - 4/7 + 4/9 ...

Explanation:

Is the same as the example,

If Π/4 = 1 - 1/3 + 1/5 - 1/7 + 1/9 ...

Then

(Π/4 )*4= 4*(1 - 1/3 + 1/5 - 1/7 + 1/9 ...)

Π =4 - 4/3 + 4/5 - 4/7 + 4/9 ...

The way to write this is

Sum(from n=0 to n=inf) of (-1)^n 4/(2n+1)

(photo)

6 0
4 years ago
You work for a printing company, and you realize that your colleague sent incorrect price quotes to a client. You begin to write
xxTIMURxx [149]

Answer:

The sentence excerpted from the e-mail uses passive voice.  

Given the  purpose of your message, this voice is appropriate.

Explanation:

Because the objective is to remedy the situation a passive voice is great because it emphasizes the action and the object instead of the subject.

We want to emphasize the document and the incorrect information, not our colleague.

4 0
3 years ago
Reduce the force F ij = + (2 5 ) kN to point A(2m,3m) that acts on point B( 3m,5m) - .
Alexxx [7]

Given :

Force, \vec{F}= (2\hat{i} + 5\hat{j})\ kN.

Force is acting at point A( 2 m, 3 m ) and B( 3 m, 5 m )

To Find :

The work done by force F .

Solution :

Displacement vector between point A and B is :

\vec{d} = (3-2)\hat{i} + (5-3)\hat{j}\\\\\vec{d} = \hat{i} + 2\hat{j}

Now, we know work done is given by :

W = \vec{F}.\vec{d}\\\\W= (2\hat{i} + 5\hat{j}).(\hat{i}+\hat{2j})\\\\W = (2\times 1) +( 5\times 2) \ kJ\\\\W = 12 \ kJ

W = 12000 J

Therefore, work done by force is 12000 J .

6 0
3 years ago
Other questions:
  • Which option is a potential environmental risk of adopting a new technology?
    5·1 answer
  • Q1. In electronic circuits it is not unusual to encounter currents in the microampere range. Assume a 35 μA current, due to the
    13·1 answer
  • A(n) _________ is a current greater than the equipment rated current or conductor ampacity, which is confined to the normal cond
    12·1 answer
  • What considerations are included in the Preliminary Floodproofing/Retrofitting Preference Matrix?
    7·1 answer
  • Create an abstract class DiscountPolicy. It should have a single abstract method computeDiscount that will return the discount f
    7·1 answer
  • A train which is traveling at 70 mi/hr applies its brakes as it reaches point A and slows down with a constant deceleration. Its
    12·1 answer
  • A square isothermal chip is of width w 5 mm on a side and is mounted in a substrate such that its side and back surfaces are wel
    11·1 answer
  • Please help me:<br> Use the Node analysis to find the power of all resistors
    9·1 answer
  • 2. The following segment of carotid artery has an inlet velocity of 50 cm/s (diameter of 15 mm). The outlet has a diameter of 11
    13·1 answer
  • which of the following tools is used for measuring small diameter holes which a telescoping gauge cannot fit into? A. telescopin
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!