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
Artist 52 [7]
3 years ago
6

CHALLENGE ACTIVITY 1.4.1: Basic syntax errors. Type the statements. Then, correct the one syntax error in each statement. Hints:

Statements end in semicolons, and string literals use double quotes. System.out.println("Predictions are hard."); System.out.print("Especially '); System.out.println("about the future."). System.out.println("Num is: " - userName);
Engineering
1 answer:
Lunna [17]3 years ago
8 0

Answer:

Lets check each statement for the errors.

Explanation:

System.out.println("Predictions are hard.");

This statement has no syntax errors. When this statement is executed the following line will be displayed:

Predictions are hard.

System.out.print("Especially ');

This statement is missing the closing quotation mark. A single quotation mark is placed instead of double quotation mark in the statement.

The following error message will be displayed when this program statement will be compiled:

Main.java:15: error: unclosed string literal

String literals use double quotes. So to correct this syntax error, the statement should be changed as follows:

System.out.print("Especially");

The output of this corrected line is as following:

Especially

System.out.println("about the future.").

In this line a period . is placed at the end of the statement instead of a semicolon ; but according to the syntax rules statements should end in semicolons.

The error message displayed when this line is compiled is as following:

Main.java:15: error: ; expected

Main.java:15: error: not a statement

So in order to correct this syntax error the statement should be changed as following:

System.out.println("about the future.");    

The output of this corrected line is as following:

about the future

System.out.println("Num is: " - userName);

There is a syntax error in this statement because of - symbol used instead of +

+ symbol is used to join together a variable and a value a variable and another variable in a single print statement.

The error message displayed when this line is compiled is as following:

Main.java:13: error: bad operand types for binary operator '-'

So in order to correct this syntax error the statement should be changed as following:

System.out.println("Num is: " + userName);

This line will print two things one is the string Num is and the other is the value stored in userName variable.

So let userName= 5 then the output of this corrected line is as following:

Num is: 5

You might be interested in
Chemical engineering got is unofficial start around the time of the __________ __________ ________.
Yuri [45]
World war II i think
6 0
4 years ago
The thermodynamic property used to determine the amount of work produced by a power turbine in a heat engine is:_______
Sveta_85 [38]

Answer:

Enthalpy

Explanation:

Thermodynamic properties could be Intensive or extensive properties. Intensive properties are those that don't depend on the quantity of matter. Examples are pressure & temperature. Meanwhile, extensive properties are those whose values depend on the mass of the system. Examples are Energy, enthalpy and volume.

Now, in turbines in thermodynamics, the work done is produced by the flow required to turn the turbine and shaft. Recall that from the law of conservation of energy, the work in the turbine per mass airflow would be equal to the change in specific enthalpy of the flow from the entrance to the exit point of the turbine.

Thus, the property required to determine the work is Enthalpy.

3 0
3 years ago
One of the flaws in the engineers' reasoning for galloping gertie's design was that they attributed prior failures of suspension
Jlenok [28]
False i think it would be
3 0
3 years ago
What classification is an E7018?<br><br> will give brainliest
Hunter-Best [27]

Answer: E7018 is a low-hydrogen iron powder type electrode that produces high quality x-ray welds. It can be used in all positions on AC or DC reverse polarity welding current.

Explanation: Hope this helps

3 0
3 years ago
Convert the following pairs of voltage and current waveforms to phasor form. Each pair of waveforms corresponds to an unknown el
exis [7]

Answer:

a) V = 20 ∠30⁰    ,    I = 4 ∠-210⁰    Z inductive    L = 0,0125 H

b) V = 9∠-60⁰      ,    I = 4 ∠ 190⁰    Z capacitive C = 4,94 *10⁻⁴ F

c) V = 13 ∠240⁰   ,    I = 7 ∠ 150⁰    Z Inductive  L = 0,0074 H

Explanation:

a) v(t) = 20 cos (400*t + 30 )

Phasor form    V = 20 ∠30⁰

i(t) = 4 sin (400*t - 120)

First we need to transform 4sin( 400t - 120 ) as  function cosine

we know that  sin ( x + 90 )  =  cos x

Then  sin ( 400*t -120 )  = cos ( 400*t  - 120 -90 )  = cos ( 400t - 120 - 90)

Phasor form  I = 4 ∠-210⁰

To have the impedance nature we compute

Z = V / I      ⇒  Z = 20 ∠30⁰ / 4  ∠-210⁰    Z = 5 ∠-180⁰

We notice that  voltage advances the current then we are in presence of an inductive impedance

5 = wl      ⇒  5  = 400 *L       ⇒  L  =    0,0125 H        

b) v(t) = 9 cos ( 900t - 60 )

V = 9∠-60⁰

i(t)  = 4 sin ( 900t + 280 )    ⇒  i(t) = 4 cos ( 900t + 280 - 90)

i(t) = 4 cos (900t + 190 )    ⇒  I = 4 ∠ 190⁰

Z = V/I    ⇒  Z = 9∠-60⁰ / 4  ∠ 190⁰    Z = 2,25 ∠-250

In this case the current advances the voltage. Impedance capacitive

1/wc  = 1/ 900*C       1/wc = Z   ⇒ 2,25 = 1/ 900*C

2,25*900 = 1/C     ⇒  2025 =1/C     ⇒  C = 4,94 *10⁻⁴ F

c) v(t) = - 13 cos ( 250t + 60 )

v(t) = 13 cos ( 250t + 60 +180 )    ⇒ v(t) = 13 cos ( 250t +240)

Phasor Form

V = 13 ∠240⁰

i(t) = 7 sin (250t + 240 - 90)  ⇒  i(t) = 7 sin (250t + 150)

Phasor Form  I = 7  ∠150⁰

Z = 13∠240⁰ / 7 ∠150⁰    ⇒  Z = 1,86 ∠ 90⁰

Voltage advances the current then the impedance is inductive

wl = 250L     250 L = 1,86     L  = 1,86/250     L = 0,0074 H

7 0
3 years ago
Other questions:
  • Identify the types of bonding that occur within a polymer system and how this affects its properties
    9·1 answer
  • I want to cancel my subscription
    5·2 answers
  • What is one disadvantage of analog recording?
    7·1 answer
  • 1. The area of the given triangle is 25 square units. What is the value of x?<br> X+2
    8·1 answer
  • A gas is compressed isothermally in a piston-cylinder assembly from 7.6 bar, 77 °C to 3.05 bar. Determine the work and heat tran
    11·1 answer
  • Consider a 50-mH inductor. a. Express the voltage across the inductor and then evaluate it at t = 0.25 s if iL (t) = 5e −2t + 3t
    10·1 answer
  • PLEASE HELP ME RIGHT NOW!!
    11·1 answer
  • If a bicycle has 2 gears in the front, and 5 in the rear, how many different combinations of gears are possible?
    10·1 answer
  • A genetically engineered hormone,___________, can treat Mary’s child for growth hormone deficiencies by stimulating body growth
    7·1 answer
  • A(n) _____________ is used commonly in open split-phase motors to disconnect the start winding from the electrical circuit when
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!