answer.
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]
2 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]2 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
Who want to play "1v1 lol unblocked games 76"
kotegsom [21]

Answer:I want to play what game?

Explanation:

3 0
2 years ago
Read 2 more answers
An automobile having a mass of 900 kg initially moves along a level highway at 100 km/h relative to the highway. It then climbs
creativ13 [48]

Answer:

ΔKE=-347.278 kJ

ΔPE= 441.45 kJ

Explanation:

given:

mass m=900 kg

the gravitational acceleration g=9.81 m/s^2

the initial velocity V_{1}=100 km/h-->100*10^3/3600=27.78 m/s

height above the highway h=50 m

h1=0m

the final velocity V_{F}=0 m/s

<u>To find:</u>

the change in kinetic energy ΔKE

the change in potential energy ΔPE

<u>assumption:</u>

We take the highway as a datum

<u>solution:</u>

ΔKE=5*m*(V_{F}^2-V_{1}^2)

      =-347.278 kJ

ΔPE=m*g*(h-h1)

      = 441.45 kJ

5 0
2 years ago
An electric field is expressed in rectangular coordinates by E = 6x2ax + 6y ay +4az V/m.Find:a) VMN if point M and N are specifi
Fittoniya [83]

Answer:

a.) -147V

b.) -120V

c.) 51V

Explanation:

a.) Equation for potential difference is the integral of the electrical field from a to b for the voltage V_ba = V(b)-V(a).

b.) The problem becomes easier to solve if you draw out the circuit. Since potential at Q is 0, then Q is at ground. So voltage across V_MQ is the same as potential at V_M.

c.) Same process as part b. Draw out the circuit and you'll see that the potential a point V_N is the same as the voltage across V_NP added with the 2V from the other box.

Honestly, these things take practice to get used to. It's really hard to explain this.

3 0
2 years ago
The closed tank of a fire engine is partly filled with water, the air space above being under pressure. A 6 cm bore connected to
skelet666 [1.2K]

Answer:

The air pressure in the tank is 53.9 kN/m^{2}

Solution:

As per the question:

Discharge rate, Q = 20 litres/ sec = 0.02\ m^{3}/s

(Since, 1 litre = 10^{-3} m^{3})

Diameter of the bore, d = 6 cm = 0.06 m

Head loss due to friction, H_{loss} = 45 cm = 0.45\ m

Height, h_{roof} = 2.5\ m

Now,

The velocity in the bore is given by:

v = \frac{Q}{\pi (\frac{d}{2})^{2}}

v = \frac{0.02}{\pi (\frac{0.06}{2})^{2}} = 7.07\ m/s

Now, using Bernoulli's eqn:

\frac{P}{\rho g} + \frac{v^{2}}{2g} + h = k                  (1)

The velocity head is given by:

\frac{v_{roof}^{2}}{2g} = \frac{7.07^{2}}{2\times 9.8} = 2.553

Now, by using energy conservation on the surface of water on the roof and that in the tank :

\frac{P_{tank}}{\rho g} + \frac{v_{tank}^{2}}{2g} + h_{tank} = \frac{P_{roof}}{\rho g} + \frac{v_{tank}^{2}}{2g} + h_{roof} + H_{loss}

\frac{P_{tank}}{\rho g} + 0 + 0 = \0 + 2.553 + 2.5 + 0.45

P_{tank} = 5.5\times \rho \times g

P_{tank} = 5.5\times 1\times 9.8 = 53.9\ kN/m^{2}

4 0
2 years ago
referring to either the CMS file or code book index, what is the cross reference for reduction of a dislocation?
Oksi-84 [34.3K]

Answer:

reposition

Explanation:

if you go to your icd 10 pcs index located on page 1 then  look up reduction the subterm is of a dislocation which leads you to the answer reposition

4 0
2 years ago
Other questions:
  • 1. Create a class called Name that represents a person's name. The class should have fields named firstName representing the per
    8·2 answers
  • Write multiple if statements: If carYear is before 1967, print "Probably has few safety features." (without quotes). If after 19
    6·1 answer
  • Air whose density is 0.082 lbm/ft3 enters the duct of an air-conditioning system at a volume flow rate of 450 ft3/min. If the di
    8·2 answers
  • Python Homework
    12·1 answer
  • A commercial refrigerator with refrigerant-134a as the working fluid is used to keep the refrigerated space at -30C by rejecting
    13·1 answer
  • A sample of normally consolidated clay was subjected to a CU triaxial compression test that was carried out until the specimen f
    6·1 answer
  • An equation used to evaluate vacuum filtration is Q = ΔpA2 α(VRw + ARf) , Where Q ≐ L3/T is the filtrate volume flow rate, Δp ≐
    13·1 answer
  • The u velocity component of a steady, two-dimensional, incompressible flow field is u = 3 ax 2 - 2 bxy, where a and b are consta
    6·1 answer
  • According to the EWR specifications, ___ is responsible for picking up and disposing of debris or rubbish from
    15·1 answer
  • Find the velocity and rate of flow of water through a rectangular channel of 6m wide and 3m deep when it's running full. The cha
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!