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
10. True or False: You should select your mechanic before you experience vehicle failure.
ra1l [238]

Answer:

True

Explanation:

Always see a professional if you have any issues that is not in your scope of practice

7 0
3 years ago
Read 2 more answers
Which of the following would be addressed by an employer completing an EAP template?
zloy xaker [14]
I can help you, but what are the options that were given to you?
4 0
2 years ago
Recall the steps of the engineering design process. Compare and contrast the
Marta_Voda [28]

Answer:

hi

Explanation:

hiiiiiiiiiiiiiiiiiiiiiiiii

3 0
2 years ago
The Hoover Dam is 221 m tall and 379 m wide. Approximating it as a flat plate, determine the effective resultant force on the da
IrinaVladis [17]

Answer:

2165800 Pa

Explanation:

See it in the pic.

3 0
2 years ago
2. What is an important aspect of the American free enterprise system that encourages people to
rusak2 [61]
Have a positive mindset and attitude
7 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following statements do not correctly describe pull manufacturing? (1). Material flow is determined by the need of
    8·1 answer
  • Oil with a specific gravity of 0.72 is used as the indicating fluid in a manometer. If the differential pressure across the ends
    6·1 answer
  • Consider a cubical furnace with a side length of 3 m. The top surface is maintained at 700 K. The base surface has emissivity of
    13·1 answer
  • Assuming the torsional yield strength of a compression spring is 0.43Sut and the maximum shear stress is equal to 434MPa. What i
    9·1 answer
  • Which process is a from of mechanical weathering
    8·1 answer
  • The steel bar has a 20 x 10 mm rectangular cross section and is welded along section a-a. The weld material has a tensile yield
    11·1 answer
  • Please Help !!
    5·1 answer
  • Question 3 (5 points)
    7·1 answer
  • What are atomic bombs made out of <br> Just wondering
    10·1 answer
  • The complete stress distribution obtained by superposing the stresses produced by an axial force and a bending moment is correct
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!