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
Oksanka [162]
3 years ago
6

userInput = scnr.nextLine(); firstLetter = scnr.nextLine().charAt(0); if ( = firstLetter ) { System.out.println("Found match: "

+ firstLetter); } else { System.out.println("No match: " + firstLetter); } return;
Engineering
1 answer:
Darina [25.2K]3 years ago
5 0

Complete Question

Write an expression to detect that the first character of userInput matches firstletter

import java.util.Scanner;

public class CharMatching

{

public static void main (String [] args)

{

Scanner scnr = new Scanner (System.in);

string userInput;

char firstLetter;

userInput = scnr.nextLine();

firstLetter = scnr.nextLine().charAt(0);

if ( = firstLetter ) {// Your solution goes here

System.out.println("Found match: " + firstLetter); }

else { System.out.println("No match: " + firstLetter); }

return;

}

}

Answer:

Replace if( = firstLetter) with the following

if(userInput.CharAt(0) == firstLetter)

What the above code segment does is that it extracts the first character of userInput and compare it with the content of firstLetter

The full program becomes

import java.util.Scanner;

public class CharMatching

{

public static void main (String [] args)

{

Scanner scnr = new Scanner (System.in);

string userInput;

char firstLetter;

userInput = scnr.nextLine();

firstLetter = scnr.nextLine().charAt(0);

if(userInput.CharAt(0) == firstLetter){

System.out.println("Found match: " + firstLetter); }

else { System.out.println("No match: " + firstLetter); }

return;

}

}

Explanation:

You might be interested in
A spherical balloon with a diameter of 9 m is filled with helium at 20°C and 200 kPa. Determine the mole number and the mass of
SIZIF [17.4K]

Answer:

<em>number of mole is 31342.36 moles</em>

<em>mass is 125.369 kg</em>

<em></em>

Explanation:

Diameter of the spherical balloon d = 9 m

radius r = d/2 = 9/2 = 4.5 m

The volume pf the sphere balloon ca be calculated from

V = \frac{4}{3} \pi r^3

V = \frac{4}{3}* 3.142* 4.5^3 = 381.75 m^3

Temperature of the gas T = 20 °C = 20 + 273 = 293 K

Pressure of the helium gas = 200 kPa = 200 x 10^3 Pa

number of moles n = ?

Using

PV = nRT

where

P is the pressure of the gas

V is the volume of the gas

n is the mole number of the gas

R is the gas constant = 8.314 m^3⋅Pa⋅K^−1⋅mol^−1

T is the temperature of the gas (must be converted to kelvin K)

substituting values, we have

200 x 10^3 x 381.75 = n x 8.314 x 293

number of moles n  = 76350000/2436 = <em>31342.36 moles</em>

We recall that n = m/MM

or m = n x MM

where

n is the number of moles

m is the mass of the gas

MM is the molar mass of the gas

For helium, the molar mass = 4 g/mol

substituting values, we have

m = 31342.36 x 4

m = 125369.44 g

m =<em> 125.369 kg</em>

3 0
3 years ago
8) Microsoft Windows is
Alisiya [41]
The Answer Is C. A collection of computer programs or applications along with its related data
Hope this helps
8 0
2 years ago
The flow rate in the pipe system below is 0.05 m3/s. The pressure at point 1 is measured to be 260 kPa. Point 1 is 0.60 m higher
DedPeter [7]

Answer:

Explanation:

The rate of flow in the pipe system in Figure P4.5.2 is 0.05 m3/s. The pressure at point 1 is measured to be 260 kPa. All the pipes are galvanized iron with roughness value of 0.15 mm. Determine the pressure at point 2. Take the loss coefficient for the sudden contraction as 0.05 and v = 1.141 × 10−6 m2/s.

The answer to the above question is

The pressure at point 2 = 75.959 kPa

Explanation:

Bernoulli's equation with losses gives

hL = z₁ - z₃ +(P₁-P₃)/(ρ×g) + (v₁²-v₃²)/(2×g)

Between points 1 and 2, z₁ = z₃ + 0.6 m therefore

hL = 0.6 m +(P₁-P₂)/(ρ×g) + (v₁²-v₃²)/(2×g)

hL = (f₁×L₁×v₁²)/(D₁×2×g) + (f₂×L₂×v₂²)/(D₂×2×g) + (f₃×L₃×v₃²)/(D₃×2×g) + k×V₃₂/(2×g) = 0.6 +(P₁-P₂)/(ρ×g) + (v₁²-v₃²)/(2×g)

But v = Q/A

or  since A = π×D²/4 we have

A₁ = 1.77×10-2 m² , A₂ = 5.73×10-2 m², A₃ = 3.8×10-2 m²  

Therefore from v = Q/A we have v₁ = 2.83 m/s v₂ = 0.87 m/s and v₃  = 1.315 m/s  from there we find the friction coefficient from Moody Diagram as follows

ε = \frac{Roughness _. value}{ Diameter} Which gives

the friction coefficients as f₁ = 0.02, f₂ = 0.017 and f₃ =0.0175

Substituting he above values into the h_{l} equation we get h_{l} = 19.761 m

Combined head loss = 19.761 m

Hence 19.743 m  = 0.6 m +(260 kPa-P₃)/(ρ×9.81) + (6.276)/(2×9.81)

or 260 kPa-18.82 m × 9.81 m/s²×ρ=  P₃

Where ρ = density of water, we have

260000 Pa - 18.82 m×9.81 m/s²×997 kg/m³ = 75958.598 kg/m·s² = 75.959 kPa

6 0
3 years ago
6.03 Discussion: Then &amp; Now - Safety
34kurt

Answer:

Information technology is important in our lives because it helps to deal with every day's dynamic things. Technology offers various tools to boost development and to exchange information. Both these things are the objective of IT to make tasks easier and to solve many problems.

6 0
3 years ago
What does abbreviation vom stand for
MrMuchimi
It’s Volt Ohm Meter!
8 0
3 years ago
Read 2 more answers
Other questions:
  • Write a loop to print all elements in hourly_temperature. Separate elements with a -&gt; surrounded by spaces. Sample output for
    9·1 answer
  • If engineering is easy then why don't most people join?
    15·2 answers
  • Nearly__________ of all serious occupational injuries and illnesses stem from overexertion of repetitive motion.a. 1/2b. 1/4c. A
    10·1 answer
  • The Keystone Pipeline has an inside diameter of 36 inches andcarries a flow rate of 590,000 barrels of crude oil per day at 40°C
    8·1 answer
  • Consider film condensation on a vertical plate. Will the heat flux be higher at the top or at the bottom of the plate? Why?
    5·1 answer
  • How are popsicles made with juice?
    5·2 answers
  • A refrigerator with an average cop of 2.8 used to cool a well-insulated container whose contents are equivalent to 10 kg of wate
    11·1 answer
  • The skills and content of several subject areas were combined to form a new field known as a meta.........
    7·2 answers
  • Which of the following explains why truck drivers are required to take a rest period after a certain period of driving?
    8·2 answers
  • Describe two fundamental reasons why flexural strength should depend on porosity
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!