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]
3 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]3 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]3 years ago
3 0

Answer:

Please see attachment

Explanation:

Please see attachment

You might be interested in
A well-established way of power generation involves the utilization of geothermal energy-the energy of hot water that exists nat
jeka94

Answer:

the maximum thermal efficiency is 29%

Explanation:

the maximum efficiency for a thermal engine that works between a cold source and a hot source is the one of a Carnot engine. Its efficiency is given by

Maximum efficiency= 1 - T2/T1

where

T2= absolute temperature of the cold sink (environment)= 20°C + 273 = 293

T2= absolute temperature of the hot source (hot water supply) = 140°C + 273 = 413

therefore

Maximum efficiency= 1 - T2/T1 = 1 - 293/413 = 0,29 =29%

3 0
3 years ago
Need help please????????!!!!!!
Alekssandra [29.7K]

Answer A the more traing the more you will know

Explanation:

4 0
3 years ago
A commercial refrigerator with refrigerant -134a as the working fluid is used to keep the refrigerated space at -30C by rejectin
Mariana [72]

Answer:

a) 0.487

b) refrigeration load = 5.46w

c) cop = 2.24

d)ref load max = 12.43kw

Explanation:

6 0
3 years ago
Read 3 more answers
Describe ICP/OES in detail.
alex41 [277]

Answer:

ICP -OES stand for inductively coupled plasma optical emission spectroscopy

Explanation:

It is techniques that known as trace level technique which help to identify and quantify the element present in sample by using spectra emission.

The analysis process include desolvates, ionization and excitation of the sample. The sample is identify by analyzing the emission line from it and quantify by analyzing the intensity of same emission lines.

7 0
3 years ago
Read 2 more answers
What is the focus of 7th grade civics
Jobisdone [24]
C. seems like the best answer. i may be wrong so don’t quote me on that
7 0
3 years ago
Read 2 more answers
Other questions:
  • A lake with constant volume 1.1 x 10^6 m^3 is fed by a stream with a non-conservative pollutant of 2.3 mg/L and flow rate 35 m^3
    14·1 answer
  • In order to avoid slipping in the shop, your footwear should __
    10·2 answers
  • Determine the Thevenin/Norton Equivalent Circuit with respect to the terminalsa,bas shown in the figure. (Here 1A is an independ
    11·1 answer
  • Blank Complete the following paragraph pertaining to the popular audio file formats.
    7·2 answers
  • Buying shop supplies from the shop owner to work on your own car at home is an ethical practice.
    14·1 answer
  • Use the map to complete the table by selecting the boxes that best describe how ocean currents affect the
    14·1 answer
  • Fixed rate mortgage offer:
    10·1 answer
  • Question
    8·1 answer
  • Which of the following is critical when performing maintenance?
    6·1 answer
  • Can someone help me LA project pls :((
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!