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]
4 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]4 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
Why Elastic Modulus is important and on what it depends?
Bad White [126]

Answer:

The Young's Modulus of a material is a fundamental property of every material that cannot be changed. It is dependent upon temperature and pressure however. The Young's Modulus (or Elastic Modulus) is in essence the stiffness of a material. In other words, it is how easily it is bended or stretched.

Explanation:

Have a great day

5 0
3 years ago
Calculate the areas under the stress-strain curve (toughness) for the materials shown in Fig. below, (a) plot them as a
defon

Answer:

Explanation:

Wow

5 0
3 years ago
Name the main classes of polymer and define their characteristic properties
Svetlanka [38]

Answer:

Polymers are the naturally occurring or synthetic macromolecules that are composed of repeating subunits, called monomers.

The three main classes of polymers are: thermoplastic, thermosetting, and the elastomers.

Thermoplastic polymers have linear bonding. These polymers can be melted again and thus can recycled.

Thermosetting polymers have cross-linked bonding. These polymers decompose when heated and thus can not be remelted and recycled.

Elastomers have linear bonding with some cross-linking. These polymers extreme elastic extensibility and thus can revert back to its original shape after deformation, without causing any permanent damage.

8 0
4 years ago
To reduce the pressure in the fuel line the forklift operator should
Lubov Fominskaja [6]

Answer:

Shut off cylinder valve before turning off forklift.

Explanation:

7 0
2 years ago
Explain the use of the Kanban system in a production line?
AURORKA [14]

Answer:

Kanban is a tool which are design to reduce the insignificant time in the production process. The main aim of Kanban system is to delivered the exactly requirement of the process.

Kanban comes from the Japanese word which means visual card. Kanban system maintain and improve the efficiency of production.

Its purpose is satisfied the requirement of customers and control the quality of the production.

7 0
3 years ago
Other questions:
  • Two soils are fully saturated with liquid (no gas present) and the soils have the same void ratio. One soil is saturated with wa
    9·1 answer
  • The Molybdenum with an atomic radius 0.1363 nm and atomic weight 95.95 has a BCC unit cell structure. Calculate its theoretical
    15·1 answer
  • 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
  • 2. The soil borrow material to be used to construct a highway embankment has a mass unit weight of 110.0 pcf, a water content of
    11·1 answer
  • Define coordination number. How does this differ from atomic packing factor?
    7·1 answer
  • Find the mechanical average of a wheel axle System of the wheel has a radius of 1.5 feet in the accident has a radius of 6 inche
    6·1 answer
  • Calculate the number of 12 V batteries (capacity 120 Ah) needed to run a 3 kW DC motor that operates in 240 V. How many hours th
    6·1 answer
  • PLEASE HELPPPPPPP!!!!,
    10·2 answers
  • What can be used to measure the alcohol content in gasoline? A. Graduated cylinder B. Electronic tester C. Scan tool D. Either a
    5·1 answer
  • Determine the normal stress acting perpendicular to the seam, when the tube is subjected to an axial compressive force of 200
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!