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
In contouring, it is necessary to measure position and not velocity for feedback.
EastWind [94]

Answer:

(1). False, (2). True, (3). False, (4). False, (5). True.

Explanation:

The term ''contouring'' in this question does not have to do with makeup but it has to deal with the measurement of all surfaces in planes. It is a measurement in which the rough and the contours are being measured. So, let us check each questions again.

(1). In contouring, it is necessary to measure position and not velocity for feedback.

ANSWER : b =>False. IT IS NECESSARY TO MEASURE BOTH FOR FEEDBACK.

(2). In contouring during 2-axis NC machining, the two axes are moved at the same speed to achieve the desired contour.

ANSWER: a=> True.

(3). Job shop is another term for process layout.

ANSWER: b => False

JOB SHOP IS A FLEXIBLE PROCESS THAT IS BEING USED during manufacturing process and are meant for job Production. PROCESS LAYOUT is used in increasing Efficiency.

(4). Airplanes are normally produced using group technology or cellular layout.

ANSWER: b => False.

(5). In manufacturing, value-creating time is greater than takt time.

ANSWER: a => True.

8 0
3 years ago
A) For Well A, provide a cross-section sketch that shows (i) ground elevation, (ii) casing height, (iii) depth to
Ad libitum [116K]
Don’t go on that file will give a virus! Sorry just looking out and I don’t know how to comment!
7 0
3 years ago
-Mn has a cubic structure with a0 = 0.8931 nm and a density of 7.47 g/cm3. -Mn has a different cubic structure, with a0 = 0.63
Fudgin [204]

Answer:

The percentage volume change is -3.0%

Explanation: We are to determine the percentage change that will occurs is alpha-Mn is transformed to beta-Mn

Value are defined as;

Cubic structure (a0) for alpha-Mn = 0.8931nm = 0.8931e-9m = 7.1236e-28cm3

Cubic structure (a0) for beta-Mn = 0.6326nm = 0.6326e-9m = 2.5316e-28cm3

Density of alpha-Mn = 7.47g/cm3

Density of beta-Mn = 7.26g/cm3

Atomic weight of Mn = 54.938g/mol

Atomic radius of Mn = 0.112nm

STEP1: CALCULATE THE ATOM NUMBER PER CELL IN THE ALPHA-Mn;

Atom per cell = (density × cubic structure × Avogadro's constant) ÷ (atomic weight ) × 100000

(7.47× 7.1236e-28 × 6.02e23) ÷ 54.938 = 58.31

Therefore the number of Atom in alpha-Mn is 58.31 atom per cell

STEP2: CALCULATE THE NUMBER OF ATOM PER CELL IN THE BETA-Mn

Atom per cell = (density × cubic structure × Avogadro's constant) ÷ (atomic weight) × 1000000

(7.26 × 2.5316e-28 × 6.02e23) ÷ 54.938 = 20.14

Therefore the number of Atom in beta-Mn is 20.14 atom per cell

STEP3: CALCULATE THE PERCENTAGE VOLUME OF ALPHA-Mn AND BETA-Mn

V% = [(volume of atom × number of atom per cell) ÷ volume of unit cell] × 1000

For Alpha-Mn:

[(1.4049e-30 × 58.31) ÷ 7.1236e-28] × 1000 = 114.998%

For Beta-Mn:

[(1.4049e-30 × 20.14) ÷ 2.5316e-28] × 1000 = 111.766%

STEP4: CALCULATE THE CHANGE IN PERCENTAGE VOLUME FOR ALPHA TO TRANSFORM TO BETA

change = final state - initial state

Therefore;

Change = 111.766 - 114.998 = -3.23%

Therefore for a transformation of Alpha-Mn to Beta-Mn they will be a decrease in volume

3 0
3 years ago
Tech A says that the brake pedal uses leverage to multiply foot pressure. Tech B says that when braking hard while moving
Nikolay [14]

Tech- A is correct

Explanation:

  • Leverage is defined as using a tool to gain mechanical influence. The measure of the benefit gained depends on what kind of lever is used and how it is utilized.
  • Leverage is designed in such a way that it can reproduce the force from your leg many times before any force is transferred to brake fluid.
  • The brake pedal size and the measure of leverage received depends on the overall design of the brake system.
  • The second-order lever is used in the brake pedal. The brake pedal applies leverage to populate the force employed to the master cylinder. The effort needed to drive a load depends on the corresponding distance of the load and the work from the fulcrum. The proportion of load and work is known as mechanical advantage.
7 0
4 years ago
HAPPINESS DISCUSSION
RideAnS [48]

Answer:

uh because life sucks o_<

8 0
3 years ago
Read 2 more answers
Other questions:
  • There are 20 forging presses in the forge shop of a small company. The shop produces batches of forgings requiring a setup time
    10·1 answer
  • Are all transmissions fluids interchangeable
    5·1 answer
  • Which two is right about febuary 14
    7·2 answers
  • What Degree Do You Need To Become a Solar Engineer?<br> (2 or more sentences please)
    13·1 answer
  • 2. One of the many methods used for drying air is to cool the air below the dew point so that condensation or freezing of the mo
    12·1 answer
  • In a semiconductor manufacturing process, three wafers from a lot are tested. Each wafer is classified as pass or fail. Assume t
    15·1 answer
  • Explain why the following acts lead to hazardous safety conditions when working with electrical equipmentA) Wearing metal ring o
    11·1 answer
  • Identify the different engineering activities/steps in the engineering design process for each steps,summarize in 1–3 sentences
    13·1 answer
  • Workers who work with what kind of chemicals chemicals may require regular medical checkups on a more frequent basis as a result
    15·1 answer
  • What is chemical engieering ?​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!