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
In the planning process of the product development life cycle what is it important to inventory
Verizon [17]

Your Answer would be A I believe.

6 0
3 years ago
Provide an argument justifying the following claim: The average (as defined here) of two Java ints i and j is representable as a
ahrayia [7]

Answer:

public static int average(int j, int k) {

return (int)(( (long)(i) + (long)(j) ) /2 );

}

Explanation:

The above code returns the average of two integer variables

Line 1 of the code declares a method along with 2 variables

Method declared: average of integer data type

Variables: j and k of type integer, respectively

Line 2 calculates the average of the two variables and returns the value of the average.

The first of two integers to average is j

The second of two integers to average is k

The last parameter ensures average using (j+k)/2

3 0
3 years ago
Casein, a dairy product used in making cheese, contains 25% moisture when wet. A dairy sells this product for $40/100 kg. If req
Nataly_w [17]

Based on the percent moisture content of the dried product, the mass of dried casein produced os 852.3 kg.

<h3>What is the mass of casein in wet casein?</h3>

The mass of casein in 1000 Kg of wet casein is 75% 1000 kg = 750 Kg

Mass of water 250 kg

The mass of casein is constant while the moisture content can be changed.

At 12% moisture content;

750 kg = 88%%

100 % = 100 ×750/88 = 852.27 kg

Therefore, the mass of dried casein produced os 852.3 kg.

Learn more about mass at: brainly.com/question/24658038

#SPJ1

3 0
2 years ago
Define the word vision statement​
Elena L [17]

Answer:

A vision statement describes what a company desires to achieve in the long-run, generally in a time frame of five to ten years, or sometimes even longer. It depicts a vision of what the company will look like in the future and sets a defined direction for the planning and execution of corporate-level strategies.

Explanation:

While companies should not be too ambitious in defining their long-term goals, it is critical to set a bigger and further target in a vision statement that communicates a company’s aspirations and motivates the audience. Below are the main elements of an effective vision statement:

-Forward-looking

-Motivating and inspirational

-Reflective of a company’s culture and core values

-Aimed at bringing benefits and improvements to the organization in the future

-Defines a company’s reason for existence and where it is heading

7 0
3 years ago
Why might construction crews want to install pipes before the foundation is poured?
denpristay [2]
I’m a concrete mason myself and I can tell you it is a pain in the butt to Roto hammer a hole into the concrete to put the pipe in it’s a lot easier to just pour the concrete around it
6 0
3 years ago
Other questions:
  • A parison is extruded from a die with outside diameter = 11.5 mm and inside diameter = 7.5 mm. The observed die swell = 1.25. Th
    8·1 answer
  • The steel 4140 steel contains 0.4% C, however, it shows higher yield strength and ultimate strength than that of the 1045 (0.45%
    14·1 answer
  • How are isometric drawings and orthographic drawings similar?
    10·1 answer
  • Find the equivalent impedance Zeq seen by the source when Vs = 2 cos (5t) v, C = 0.2 F, R = 1 Ω and L = 0.1 H. (Give angles in d
    12·1 answer
  • Supón que tienes que calcular el centro de gravedad de una pieza
    11·1 answer
  • (d) Suppose two students are memorizing a list according to the same model dL dt = 0.5(1 − L) where L represents the fraction of
    6·1 answer
  • Tech A says that in some cases, the electronic brake control module can be programmed with a new tire size to restore proper ele
    7·1 answer
  • Who does each person work for? Monica works for a power company, Travis works for a utilities company, and Maggie is self-employ
    15·2 answers
  • Identify three questions a patient might ask of the nuclear medicine technologist performing a nuclear medicine exam.
    11·1 answer
  • Key term of Bimetal strip
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!