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

Answer:

Please see attachment

Explanation:

Please see attachment

You might be interested in
Is an isothermal process necessarily internally reversible? Explain your answer with an example
torisob [31]

Answer:

please give me brainlist and follow

Explanation:

Example of an irreverseble isothermal process is mixing of two fluids on the same temperature - it requires a lot of energy to unmix Jack and coke. ... Example of an reversible process with changing temperature is isentropic expansion.

5 0
1 year ago
Derive an equation for the work of a mechanically reversible, isothermal compression of 1 mol of a gas from an initial pressure
Lyrx [107]

Answer:

The long derivation for work of a mechanically reversible, isothermal compression was done with detailed steps as shown in the attachment.

Explanation:

what is applied here is a long derivation from Work done in an isobaric process, the expression for the compressibility factor (Z) and the equation of state that was given. The requisite knowledge of Differentiation and Integration was used.

The detailed derivation from firs principle is as shown in the attachment.

5 0
2 years ago
What is the physical significance of the Reynolds number?. How is defined for external flow over a plate of length L.
yanalaym [24]

Answer:

Re=\dfrac{\rho\ v\ l}{\mu }

Explanation:

Reynolds number:

  Reynolds number describe the type of flow.If Reynolds number is too high then flow is called turbulent flow and Reynolds is  low then flow is called laminar flow .

Reynolds number is a dimensionless number.Reynolds number given is the ratio of inertia force to the viscous force.

Re=\dfrac{F_i}{F_v}

For plate can be given as

Re=\dfrac{\rho\ v\ l}{\mu }

Where  ρ is the density of fluid , v is the average velocity of fluid and μ is the dynamic viscosity of fluid.

Flow on plate is a external flow .The values of Reynolds number for different flow given as

Reynolds\ number\is \ >\ 5 \times 10 ^5\ then\ flow\ will\ be\ turbulent.

Reynolds\ number\is \

7 0
2 years ago
The 8-mm-thick bottom of a 220-mm-diameter pan may be made from aluminum (k = 240 W/m ⋅ K) or copper (k = 390 W/m ⋅ K). When use
Artemon [7]

Answer:

For aluminum 110.53 C

For copper 110.32 C

Explanation:

Heat transmission through a plate (considering it as an infinite plate, as in omitting the effects at the borders) follows this equation:

q = \frac{k * A * (th - tc)}{d}

Where

q: heat transferred

k: conduction coeficient

A: surface area

th: hot temperature

tc: cold temperature

d: thickness of the plate

Rearranging the terms:

d * q = k * A * (th - tc)

\frac{d * q}{k * A} = th - tc

th = \frac{d * q}{k * A} + tc

The surface area is:

A = \frac{\pi * d^2}{4}

A = \frac{\pi * 0.22^2}{4} = 0.038 m^2

If the pan is aluminum:

th = \frac{0.008 * 600}{240 * 0.038} + 110 = 110.53 C

If the pan is copper:

th = \frac{0.008 * 600}{390 * 0.038} + 110 = 110.32 C

7 0
2 years ago
Twenty distinct cars park in the same parking lot every day. Ten of these cars are US-made, while the other ten are foreign-made
Zina [86]

Answer:

Total no. of ways to line up cars is 20! = 2.43 c 10^18

Probability that the cars alternate is 0.00001 or 0.001%

Explanation:

Since, the position of a car is random.Therefore, number ways in which cars can line up is given as:

<u>No. of ways = 20! = 2.43 x 10^18</u>

For the probability that cars alternate, two groups will be formed, one consisting of US-made 10 cars and other containing 10 foreign made. The number of favorable outcomes for this can be found out as the arrangements of 2! between these groups multiplied by the arrangements of 10! for each group, due to the arrangements among the groups themselves.

Favorable Outcomes = 2! x 10! x 10!

Thus the probability of event will be:

Probability = Favorable Outcomes/Total No. of Ways

Probability = (2! x 10! x 10!)/20!

<u>Probability = 0.00001 = 0.001%</u>

4 0
2 years ago
Other questions:
  • The wall of drying oven is constructed by sandwiching insulation material of thermal conductivity k = 0.05 W/m°K between thin me
    8·1 answer
  • A square loop of wire surrounds a solenoid. The side of the square is 0.1 m, while the radius of the solenoid is 0.025 m. The sq
    6·1 answer
  • PDAs with two stacks are strictly more powerful than PDAs with one stack. Prove that 2-stack PDAs are not a valid model for CFLs
    12·1 answer
  • Two metallic terminals protrude from a device. The terminal on the left is the positive reference for a voltage called vx (the o
    9·2 answers
  • Refrigerant-134a at 400 psia has a specific volume of 0.1384 ft3/lbm. Determine the temperature of the refrigerant based on (a)
    6·1 answer
  • Use the predicate specifications(x, y): x beats yF (x): x is an (American) football teamQ(x, y): x is quarterback of yL(x,y): x
    13·1 answer
  • Write cout statements with stream manipulators that perform the following:
    8·1 answer
  • Discuss your interpretation of the confidence-precision trade-off, and provide a few examples of how you might make a choice in
    14·1 answer
  • What is the linear distance traveled in one revolution of a 36-inch wheel
    6·1 answer
  • The signboard truss is designed to support a horizontal wind load of 800 lb. A separate analysis shows that 5 8 of this force is
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!