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
To measure the voltage drop across a resistor, a _______________ must be placed in _______________ with the resistor. Ammeter; S
gulaghasi [49]

Answer:

The given blanks can be filled as given below

Voltmeter must be connected in parallel

Explanation:

A voltmeter is connected in parallel to measure the voltage drop across a resistor this is because in parallel connection, current is divided in each parallel branch and voltage remains same in parallel connections.

Therefore, in order to measure the same voltage across the voltmeter as that of the voltage drop across resistor, voltmeter must be connected in parallel.

4 0
3 years ago
An example of the split-off point in oil, gasoline, and kerosene production is that point where crude oil is
eimsori [14]

i believe the correct answer is c but i’m sorry if i’m not correct

8 0
3 years ago
What should you consider when choosing the type of head protection
Serggg [28]

Answer: hope this helps u

Explanation:

Material,Flexibility,Comfort,Workplace Hazards

6 0
3 years ago
Witch truck company is better.<br><br> Ram <br> Ford <br> Toyoda<br> GMC
arlik [135]
Ram is the better truck company
7 0
3 years ago
Read 2 more answers
Water enters a tank from two pipes, one with a flow rate of 0.3 kg/s and the other with a flow rate of 0.1 kg / s. The tank has
stiks02 [169]

Answer:

total amount of water after 2 min will be 84.4 kg/s

Explanation:

Given data:

one tank inflow = 0.1 kg/s

2nd tank inflow = 0.3 kg/s

3rd tank outflow = 0.03 kg/s

Total net inflow in tank is = 0.3 +0.1 =0.4 kg/s

From third point, outflow is 0.03 kg/s

Therefore, resultant in- flow = 0.4 - 0.03

Resultant inflow is  = 0.37 kg/s

Tank has initially 40 kg water

In 2 min ( 2*60 sec), total inflow in tank is 0.37*60*2 = 44.4 kg

So, total amount of water after 2 min will be = 40+44.4 = 84.4 kg

8 0
3 years ago
Other questions:
  • Remy noticed that after oiling his skateboard wheels, it was easier to reach the speeds he needed to perform tricks. How did the
    6·1 answer
  • An atomic force that can attract or repel ferrous substances is<br> known as:
    14·1 answer
  • A gear box’s shaft is made of a hollow circular steel tube with allowable yield stress equal to σa????????o???? . The shaft is l
    7·1 answer
  • A 625 g basketball and a 58.5 g tennis ball are dropped from a height of d = 1.5 m onto the floor. The coefficient of restitutio
    10·1 answer
  • When wasDisney Cruise Line founded
    5·1 answer
  • An airplane flies horizontally at 80 m/s. Its propeller delivers 1300 N of thrust (forward force) to overcome aerodynamic drag (
    15·1 answer
  • I’m doing a project on renewable energy. There are 6 energy sources. Solar, wind, geothermal, hydroelectric, tidal, and biomass.
    14·2 answers
  • Technician A says when you push the horn button, electromagnetism moves an iron bar inside the horn, which opens and closes cont
    5·2 answers
  • Describe in detail the process of making a collapsable bowl.​
    11·1 answer
  • assuming complementary inputs are available, the minimum number of transistors needed to realize a two input xor gate is:
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!