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
Kamila [148]
4 years ago
9

Write a program that removes all spaces from the given input. You may assume that the input string will not exceed 50 characters

. Ex: If the input is: Hello my name is John. the output is: HellomynameisJohn. Your program must define and call the following function. userString is the user specified string. The function assigns userStringNoSpaces with the user specified string without spaces. void RemoveSpaces(char userString[], char userStringNoSpaces[]) Note: This is a lab based on a previous chapter that now requires the use of a function.

Engineering
2 answers:
GrogVix [38]4 years ago
5 0

Answer:

Program that removes all spaces from the given input

Explanation:

// An efficient Java program to remove all spaces  

// from a string  

class GFG  

{  

 

// Function to remove all spaces  

// from a given string  

static int removeSpaces(char []str)  

{  

   // To keep track of non-space character count  

   int count = 0;  

 

   // Traverse the given string.  

   // If current character  

   // is not space, then place  

   // it at index 'count++'  

   for (int i = 0; i<str.length; i++)  

       if (str[i] != ' ')  

           str[count++] = str[i]; // here count is  

                                   // incremented  

         

   return count;  

}  

 

// Driver code  

public static void main(String[] args)  

{  

   char str[] = "g eeks for ge eeks ".toCharArray();  

   int i = removeSpaces(str);  

   System.out.println(String.valueOf(str).subSequence(0, i));  

}  

}  

Law Incorporation [45]4 years ago
3 0

Answer:

Please see attachment

Explanation:

Please see attachment

You might be interested in
What was the first roblox player A.bob B.roblox C.builderman
san4es73 [151]
Builderman is dksbdkbsnsbs
5 0
3 years ago
Read 2 more answers
Write the output expression for a NOR gate with inputs , , and .​
mezya [45]

Answer:

Logic NOR Gate Equivalent

The Boolean expression for a logic NOR gate is denoted by a plus sign, ( + ) with a line or Overline, ( ‾‾ ) over the expression to signify the NOT or logical negation of the NOR gate giving us the Boolean expression of: A+B = Q.

4 0
2 years ago
What is the function maintenance? List some important steps for vibration monitoring based maintenance.
Mrrafil [7]

The maintenance is in charge of controlling that all the machines of a company are constantly running in order to avoid damages that cause loss of money when the machines fail.

The maintenance based on vibration monitoring allows to predict failures in some rotating machines such as:

1. worn bearings

2.alignment

3.balance

4. affected gears

5. bent shafts

6. rocks

7.gags

8. eccentricity

9. failures of electrical origin

4 0
3 years ago
When moving cylinders always remove and make
Karolina [17]

Unless cylinders are firmly secured on a special carrier intended for this purpose, regulators shall be removed and valve protection caps put in place before cylinders are moved. A suitable cylinder truck, chain, or other steadying device shall be used to keep cylinders from being knocked over while in use.

5 0
3 years ago
A hydraulic jump is induced in an 80 ft wide channel.The water depths on either side of the jump are 1 ft and 10 ft.Please calcu
krek1111 [17]

Answer:

a) 42.08 ft/sec

b) 3366.33 ft³/sec

c) 0.235

d) 18.225 ft

e) 3.80 ft

Explanation:

Given:

b = 80ft

y1 = 1 ft

y2 = 10ft

a) Let's take the formula:

\frac{y2}{y1} = \frac{1}{5} * \sqrt{1 + 8f^2 - 1}

10*2 = \sqrt{1 + 8f^2 - 1

1 + 8f² = (20+1)²

= 8f² = 440

f² = 55

f = 7.416

For velocity of the faster moving flow, we have :

\frac{V_1}{\sqrt{g*y_1}} = 7.416

V_1 = 7.416 *\sqrt{32.2*1}

V1 = 42.08 ft/sec

b) the flow rate will be calculated as

Q = VA

VA = V1 * b *y1

= 42.08 * 80 * 1

= 3366.66 ft³/sec

c) The Froude number of the sub-critical flow.

V2.A2 = 3366.66

Where A2 = 80ft * 10ft

Solving for V2, we have:

V_2 = \frac{3666.66}{80*10}

= 4.208 ft/sec

Froude number, F2 =

\frac{V_2}{g*y_2} = \frac{4.208}{32.2*10}

F2 = 0.235

d) El = \frac{(y_2 - y_1)^3}{4*y_1*y_2}

El = \frac{(10-1)^3}{4*1*10}

= \frac{9^3}{40}

= 18.225ft

e) for critical depth, we use :

y_c = [\frac{(\frac{3366.66}{80})^2}{32.2}]^1^/^3

= 3.80 ft

7 0
3 years ago
Read 2 more answers
Other questions:
  • 1) Pareto charts are used to: A) identify inspection points in a process. B) outline production schedules. C) organize errors, p
    6·1 answer
  • The minimum fresh air requirement of a residential building is specified to be 0.35 air changes per hour (ASHRAE, Standard 62, 1
    10·1 answer
  • To do you blur text in google docs
    10·1 answer
  • A motor vehicle has a mass of 1200kg and the road wheels have a radius of 360mm. The engine rotating parts have a moment of iner
    5·1 answer
  • Since no one is perfect is that a sentence fragment
    10·2 answers
  • Our rule-of-thumb for presenting final results is to round to three significant digits or four if the first digit is a one. By t
    12·1 answer
  • Explain the proper uses of shop equipment. (explain to me how to use 3 pieces of shop equipment.)
    7·1 answer
  • 1. Which of these materials is the strongest?
    12·1 answer
  • ⊂who else is obsessed with the ornail
    9·1 answer
  • What is the primary difference between the process of lost-wax casting as practiced in ancient times and that same process today
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!