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
Makovka662 [10]
3 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]3 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
For a very rough pipe wall the friction factor is constant at high Reynolds numbers. For a length L1 the pressure drop over the
Goshia [24]

Answer:

\Delta p_{2} = 2\cdot \Delta p_{1}

Explanation:

The pressure drop is directly proportional to the length of the pipe. Then, the new pressure drop is two time the previous one.

\Delta p_{2} = 2\cdot \Delta p_{1}

8 0
3 years ago
Which of the following is NOT true concerning the color of minerals? A. Some minerals have a consistent color, but many have a r
mixer [17]

Answer:

Option D

A mineral’s color reflects the wavelengths of light that are absorbed by the mineral.

Explanation:

Color is one of the physical properties of minerals. Many minerals have a wide range of colors but there are some minerals with one consistent color and such minerals are referred as monochromatic minerals for example azurite. Normally, the streak color tends to be less variable than the color of the whole mineral and impurities or minor chemical components in a mineral react and often control the display color of resultant mineral. Option D is incorrect since mineral's color don't reflect wavelengths of light absorbed by such minerals.

5 0
3 years ago
melinda is using a rectangular brass bar in a sculpture she is creating. the brass bar has a length that is 4 more than 3 times
lawyer [7]

Answer:

180 x 60 inches

Width = 60 inches

Length = 180 inches

Explanation:

Given

Let L = Length

W = Width

P = Perimeter

Length = 3 * Width

L = 3W

Perimeter of Brass = 480 inches

P = 480

Perimeter is given as 2(L + W);

So, 2 (L + W) = 480

L + W = 480/2

L + W = 240

Substitute 3W for L; so,

3W + W = 240

4W = 240

W = 240/4

W = 60 inches

L = 3W

L = 3 * 60

L = 180 inches

6 0
3 years ago
Read 2 more answers
Two wastewater treatment plant workers (one male and one female) are exposed to hydrogen sulfide in confined spaces in the treat
Vlada [557]

Answer:

Go to explaination for the details of the answer.

Explanation:

In order to determine the lifetime (75 years) chronic daily exposure for each individual, we have to first state the terms of our equation:

CDI = Chronic Daily Intake

C= Chemical concentration

CR= Contact Rate

EFD= Exposure Frequency and Distribution

BW= Body Weight

AT = Average Time.

Having names our variables lets create the equations that will be used to derive our answers.

Please kindly check attachment for details of the answer.

5 0
3 years ago
1. Design a circuit, utilizing set/reset coils where PB 1 starts Motor 1 and PB2 stops Motor 1. Pressing and releasing either pu
lianna [129]

Answer:

Circuit attached with explanation

Explanation:

Hi Dear,

A circuit is attached for your reference.

When you press "start" PB, the supply reaches the motor starter relay coil "M" that is also in parallel with the "start" PB which allows the motor to remain ON even when you release "start" PB as supply to relay coil is directly from supply "L" through "M".

To stop motor just press "stop" PB and the circuit breaks which de-energize the relay coil and the motor stops.

Hope this finds easy to you.

5 0
3 years ago
Other questions:
  • What are the three main areas of bioengineering?
    11·1 answer
  • A gear and shaft with nominal diameter of 34 mm are to be assembled with a medium drive fit (H7/s6). The gear has a hub, with an
    9·1 answer
  • 1 2 3 4 5 6 7 8 9 10
    14·1 answer
  • A driver is traveling at 52 mi/h on a wet road. an object is spotted on the road 415 ft ahead and the driver is able to come to
    5·2 answers
  • WILL BRAINLIEST IF CORRECT!!!!!<br><br> Some one help ASAP.
    8·1 answer
  • Which factors influence changes in consumer demands? check all that apply
    8·2 answers
  • A non-entrepreneurship, work-based, agricultural type of SAE, in which a student learns and gains skills in a paid or unpaid pos
    15·1 answer
  • A force of 16,000 will cause a 1 1 bar of magnesium to stretch from 10 to 10.036 . Calculate the modulus of elasticity in . (Ent
    6·1 answer
  • For Laminar flow conditions, what size pipe will deliver 90 gpm of medium oil at 40°F (υ = 6.55 * 10^‐5)?
    12·1 answer
  • In your role, you are responsible for making sure that delivery trucks depart from the building on time. When a truck arrives la
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!