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
An 800-kg drag racer accelerates from rest to 390 km/hr in 5.8 s. What is the net impulse applied to the racer in the first 5.8
marissa [1.9K]

Answer:

Impulse =14937.9 N

tangential force =14937.9 N

Explanation:

Given that

Mass of car m= 800 kg

initial velocity u=0

Final velocity v=390 km/hr

Final velocity v=108.3 m/s

So change in linear momentum P= m x v

           P= 800 x 108.3

 P=86640 kg.m/s

We know that impulse force F= P/t

So F= 86640/5.8 N

F=14937.9 N

Impulse force F= 14937.9 N

We know that

v=u + at

108.3 = 0 + a x 5.8

a=18.66\ m/s^2

So tangential force F= m x a

F=18.66 x 800

F=14937.9 N

6 0
4 years ago
What gadgets are charge coupled devices used in?
Alinara [238K]

Answer:

They are used in imaging application gadgets such as video cameras,TV, surveillance cameras and document scanners

Explanation:

A charge couple device (CCDs) are highly capable in imagery detector.Its common application is in video and digital imaging.The quality of a charge couple device is determined by factors such as the dynamic range, dark charge level and the quantum efficiency.These devices serve the purpose of detecting optical images though some are installed with applications for data storage.

5 0
3 years ago
Outline the process used to test the following hypothesis: Titanium cages are stronger than steel cages for hockey goalie masks.
son4ous [18]

Answer:

true

Explanation:

8 0
3 years ago
The in-situ dry density of a sand is 1.72Mg/m3. The maximum and minimum drydensities, determined by standard laboratory tests, a
Stells [14]

Answer:

Relative density = 0.7 or 70%

Explanation:

The following information was provided by this question

Pd = 1.72mg/mg³

Pd max = 1.81 mg/mg³

Pd min = 1.54 mg/mg³

We substitute into the formula. This formula is contained in the attachment.

[(1/1.54)-(1/1.72)]/[1/1.54 - 1/1.81]

= 0.649350 - 0.581395 / 0.649350 - 0.552486

= 0.067955/0.096864

= 0.7015

= 0.7

The relative density is Therefore 0.7 or 70% when converted to percentage

8 0
3 years ago
What’s Statistics<br> What are the 2 Source of error in data collection
FromTheMoon [43]

Answer:

<em>The main sources of error in the collection of data are as follows : Due to direct personal interview. Due to indirect oral interviews. Information from correspondents may be misleading.</em>

4 0
3 years ago
Read 2 more answers
Other questions:
  • EMB agar is a medium used in the identification and isolation of pathogenic bacteria. It contains digested meat proteins as a so
    10·1 answer
  • Which one of the following faults cause the coffee in a brewer to keep boiling after the brewing cycle is finished?
    7·1 answer
  • Using phasors, the value of 37 sin 50t + 30 cos(50t – 45°) is _________ cos(50t+(_____°)). Please report your answer so the magn
    5·1 answer
  • Part of the following pseudocode is incompatible with the Java, Python, C, and C++ language Identify the problem. How would you
    12·1 answer
  • A simply supported wood roof beam is loaded with single point dead and roof live loads applied at midspan (PD = 400 lb, PLr = 16
    9·1 answer
  • The grade is a measure of quality and it captures concentration levels (i.e., how pure a certain fraction is). If grade captures
    13·1 answer
  • 7. Sockets internal designs come in what sizes?
    5·1 answer
  • What is the difference between a modular home and a manufactured home?
    5·1 answer
  • The distribution of ground shaking around the fault
    5·1 answer
  • X cotx expansion using maclaurins theorem.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!