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
Makovka662 [10]
2 years ago
5

Write a static method named fixSpacing that accepts a Scanner representing a file as a parameter and writes that file's text to

the console, with multiple spaces or tabs reduced to single spaces between words that appear on the same line.

Engineering
1 answer:
Umnica [9.8K]2 years ago
8 0

Answer:

See the code and explanation below

Explanation:

Is neccesary that accepts a Scan  representing a file as a parameter and writes that file's text on the language, and we need to reduce the multiple spaces to single spaces between  words that appear using just one line. Each word is to appear on the same line  in output as it appears in the file. We need to consider that the lines can be blank.

The code on Jave is this one:

public void DavidSpaces(Scan sc) {

   while(sc.hasNextLine()) {

       String line = sc.nextLine();

       Scanner linesc = new Scan(line);

       while(linesc.hasNext())

           System.out.print(linesc.next() + " ");

       System.out.println();

   }

}

The algorithm scheme is given on the picture attached.

You might be interested in
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
A six- lane freeway ( three lanes in each direction) in a scenic area has a measured free- flow speed of 55 mi/ h. The peak- hou
Novosadov [1.4K]

Answer:

0.867

Explanation:

The driver population factor (f_{p})can be estimated using the equation below:

f_{p} = \frac{V}{PHF*N*f_{HV}*v_{p}}

The value of the heavy vehicle factor (f_{HV}) is determined below:

The values of the E_{T} = 2 and E_{R} = 3 are gotten from the tables for the RVs, trucks and buses upgrades for passenger-car equivalents. Therefore:

f_{HV} = 1/[1+0.08(2-1)+0.06(3-1)] = 1/[1+0.08+0.12] = 1/1.2 = 0.833

Furthermore, the vp is taken as 2250 pc/(h*In) from the table of LOS criteria for lane freeway using the 15 minutes flow rate. Therefore:

f_{p} = 3900/[0.8*3*0.833*2250] = 3900/4498.2 = 0.867

6 0
2 years ago
Laminar flow normally persists on a smooth flat plate until a critical Reynolds number value is reached. However, the flow can b
grandymaker [24]

Answer:

At L = 0.1 m

h⁻_lam = 11.004K   W/m^1.5

h⁻_turb = 7.8848K   W/m^1.8

At L = 1 m

h⁻_lam = 3.48K   W/m^1.5

h⁻_turb = 4.975K   W/m^1.8

Explanation:

Given that;

h_lam(x)= 1.74 W/m^1.5. Kx^-0.5

h_turb(x)= 3.98 W/m^1.8 Kx^-0.2

conditions for plates of length L = 0.1 m and 1 m

Now

Average heat transfer coefficient is expressed as;

h⁻ = 1/L ₀∫^L hxdx

so for Laminar flow

h_lam(x)= 1.74 . Kx^-0.5  W/m^1.5

from the expression

h⁻_lam = 1/L ₀∫^L 1.74 . Kx^-0.5   dx

= 1.74k / L { [x^(-0.5+1)] / [-0.5 + 1 ]}₀^L

= 1.74k/L = [ (x^0.5)/0.5)]⁰^L

= 1.74K × L^0.5 / L × 0.5

h⁻_lam= 3.48KL^-0.5

For turbulent flow

h_turb(x)= 3.98. Kx^-0.2 W/m^1.8

form the expression

1/L ₀∫^L 3.98 . Kx^-0.2   dx

= 3.98k / L { [x^(-0.2+1)] / [-0.2 + 1 ]}₀^L

= (3.98K/L) × (L^0.8 / 0.8)

h⁻_turb = 4.975KL^-0.2

Now at L = 0.1 m

h⁻_lam = 3.48KL^-0.5  =  3.48K(0.1)^-0.5  W/m^1.5

h⁻_lam = 11.004K   W/m^1.5

h⁻_turb = 4.975KL^-0.2 = 4.975K(0.1)^-0.2

h⁻_turb = 7.8848K   W/m^1.8

At L = 1 m

h⁻_lam = 3.48KL^-0.5  =  3.48K(1)^-0.5  W/m^1.5

h⁻_lam = 3.48K   W/m^1.5

h⁻_turb = 4.975KL^-0.2 = 4.975K(1)^-0.2

h⁻_turb = 4.975K   W/m^1.8

Therefore

At L = 0.1 m

h⁻_lam = 11.004K   W/m^1.5

h⁻_turb = 7.8848K   W/m^1.8

At L = 1 m

h⁻_lam = 3.48K   W/m^1.5

h⁻_turb = 4.975K   W/m^1.8

3 0
2 years ago
A cylindrical specimen of a brass alloy having a length of 60 mm (2.36 in.) must elongate only 10.8 mm (0.425 in.) when a tensil
Gemiola [76]

The radius of the specimen is 60 mm

<u>Explanation:</u>

Given-

Length, L = 60 mm

Elongated length, l = 10.8 mm

Load, F = 50,000 N

radius, r = ?

We are supposed to calculate the radius of a cylindrical brass specimen in order to produce an elongation of 10.8 mm when a load of 50,000 N is applied. It is necessary to compute the strain corresponding to this

elongation using Equation:

ε = Δl / l₀

ε = 10.8 / 60

ε = 0.18

We know,

σ = F / A

Where A = πr²

According to the stress-strain curve of brass alloy,

σ = 440 MPa

Thus,

sigma = 50,000 / \pi  (r)^2\\\\440 X 10^6 = \frac{50,000}{3.14 X (r)^2}\\\\r = 0.06m\\r = 60mm\\\\\\

Therefore, the radius of the specimen is 60 mm

3 0
2 years ago
Consider film condensation on a vertical plate. Will the heat flux be higher at the top or at the bottom of the plate? Why?
STALIN [3.7K]

Answer:

During film condensation on a vertical plate, heat flux at the top will be higher since the thickness of the film at the top, and thus its thermal resistance, is lower.

Explanation:

https://www.docsity.com/pt/cengel-solution-heat-and-mass-transfer-2th-ed-heat-chap10-034/4868218/

https://arc.aiaa.org/doi/pdf/10.2514/1.43136

https://arxiv.org/ftp/arxiv/papers/1402/1402.5018.pdf

8 0
2 years ago
Other questions:
  • A circular ceramic plate that can be modeled as a blackbody is being heated by an electrical heater. The plate is 30 cm in diame
    15·1 answer
  • A mass of 12 kg saturated refrigerant-134a vapor is contained in a piston-cylinder device at 240 kPa. Now 300 kJ of heat is tran
    8·1 answer
  • Use Lagrange multiplier techniques to find the local extreme values of the given function subject to the stated constraint. If a
    15·1 answer
  • The small 5-oz slider A moves without appreciable friction in the hollow tube, which rotates in a horizontal plane with a consta
    7·1 answer
  • The components of an electronic system dissipating 90 W are located in a 1-m-long circular horizontal duct of 15-cm diameter. Th
    11·1 answer
  • The Hamming encoder/decoder in the lecture detected and corrected one error bit. By adding a thirteen bit which is the exclusive
    13·1 answer
  • - Consider a 2024-T4 aluminum material with ultimate tensile strength of 70 ksi. In a given application, a component of this mat
    7·1 answer
  • A pair of spur gears with 20 degree pressure angle, full-depth, involute teeth transmits 65 hp. The pinion is mounted on a shaft
    5·1 answer
  • Milton has been tracking the migrating patterns of whales in the northwest Atlantic Ocean for five years. He knows where and whe
    5·2 answers
  • Draw an ERD for each of the following situations. (If you believe that you need to make additional assumptions, clearly state th
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!