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
A smooth ceramic sphere (SG 5 2.6) is immersed in a fl ow of water at 208C and 25 cm/s. What is the sphere diameter if it is enc
Aleks [24]

Answer:

a. 4\mu m

b. 1 m

Explanation:

According to the question, the data is as follows

The Density of water at 20 degrees celcius is 1000 kg/m^3

Viscosity is 0.001kg/m/.s

Velocity V = 25 cm/s

V = 0.25 m/s

Now

a. The creeping motion is

As we know that

Reynold Number = (Density of water × V × d) ÷ (Viscosity)

1 = (1,000 × 0.25 × d) ÷ 0.0001

d = (1 × 0.001) ÷ (1,000 × 0.25)

= 4E - 06^m

= 4\mu m

b. Now the sphere diameter is

Reynold Number = (Density of water × V × d) ÷ (Viscosity)

250,000 = (1,000 × 0.25 × d) ÷ 0.0001

d = (250,000 × 0.001) ÷ (1,000 × 0.25)

= 1 m

6 0
3 years ago
A furniture manufacturer purchases a drill press machine enabled with 5G and edge computing capabilities to keep the machine ope
Andreas93 [3]

A lot of manufacturer often uses 5G machines. How these capabilities could help improve safety of the operators is that it does includes an emergency switch for the operator so that one can manually shut off when needed.

<h3>Edge computing with 5G</h3>

  • The edge computing along with 5G network and IoT devices can help put together  different safety features and limitations and on can use them to known the unsafe action and also data can be communicated.

Edge computing when use with 5G produces good opportunities in all industry. It is known to help bring computation and data storage close to where data is been produced and it enable good data control, reduced costs, etc.

Learn more about 5G network from

brainly.com/question/24664177

8 0
2 years ago
Windmills slow the air and cause it to fill a larger channel as it passes through the blades. Consider a circular windmill with
Scilla [17]

Answer:

DIAMETER  = 9.797 m

POWER = \dot W = 28.6 kW

Explanation:

Given data:

circular windmill diamter D1 = 8m

v1 = 12 m/s

wind speed = 8 m/s

we know that specific volume is given as

v =\frac{RT}{P}

  where v is specific volume of air

considering air pressure is 100 kPa and temperature 20 degree celcius

v =  \frac{0.287\times 293}{100}

v = 0.8409 m^3/ kg

from continuity equation

A_1 V_1 = A_2 V_2

\frac{\pi}{4}D_1^2 V_1 = \frac{\pi}{4}D_1^2 V_2

D_2 = D_1 \sqrt{\frac{V_1}{V_2}}

D_2 = 8 \times \sqrt{\frac{12}{8}}

D_2 = 9.797 m

mass flow rate is given as

\dot m = \frac{A_1 V_1}{v} = \frac{\pi 8^2\times 12}{4\times 0.8049}

\dot m = 717.309 kg/s

the power produced \dot W = \dot m \frac{ V_1^2 - V_2^2}{2} = 717.3009 [\frac{12^2 - 8^2}{2} \times \frac{1 kJ/kg}{1000 m^2/s^2}]

\dot W = 28.6 kW

8 0
3 years ago
The output side of an ideal transformer has 35 turns, and supplies 2.0 A to a 24-W device. Ifthe input is a standard wall outlet
Crank

Answer:

The current drawn from the outlet is 0.2 A

The number of turns on the input side is 350 turns

Explanation:

Given;

number of turns of the secondary coil, Ns = 35 turns

the output current, I_s = 2 A

power supplied, P_s = 24 W

the standard wall outlet in most homes = 120 V = input voltage

For an ideal transformer; output power = input power

the current drawn from the outlet is calculated;

I_pV_p = P_s\\\\I_p = \frac{P_s}{V_p} = \frac{24}{120} = 0.2 \ A

The number of turns on the input side is calculated as;

\frac{N_p}{N_s} = \frac{I_s}{I_p}  \\\\N_p = \frac{N_sI_s}{I_p} \\\\N_p = \frac{35 \times 2}{0.2} \\\\N_p = 350 \ turns

4 0
3 years ago
Answer?...................
torisob [31]

Answer:

The correct option is;

c. Leaving the chuck key in the drill chuck

Explanation:

A Common safety issues with a drill press leaving the chuck key in the drill chuck

It is required that, before turning the drill press power on, ensure that chuck key is removed from the chuck. A self ejecting chuck key reduces the likelihood of the chuck key being accidentally left in the chuck.

It is also required to ensure that the switch is in the OFF position before turning plugging in the power cable

Be sure that the chuck key is removed from the chuck before turning on the power. Using a self-ejecting chuck key is a good way of insuring that the key is not left in the chuck accidentally. Also to avoid accidental starting, make sure the switch is in the OFF position before plugging in the cord. Always disconnect the drill from the power source when making repairs.

5 0
3 years ago
Other questions:
  • A well-insulated tank in a vapor power plant operates at steady state. Saturated liquid water enters at inlet 1 at a rate of 125
    6·2 answers
  • The type of current that flows from the electrode across the arc to the work is called what?
    5·1 answer
  • At a 4 percent annual growth rate in GDP per capita, it will take
    15·1 answer
  • Choose the best data type for each of the following so that any reasonable value is accommodated but no memory storage is wasted
    5·1 answer
  • A hot-water stream at 80°C enters a mixing chamber with a mass flow rate of 0.46 kg/s where it is mixed with a stream of cold wa
    14·1 answer
  • Write a program in C++ that can be used by a small theater to sell tickets for performances.The theater’s auditorium has 15 rows
    7·1 answer
  • A well-established way of power generation involves the utilization of geothermal energy-the energy of hot water that exists nat
    9·1 answer
  • 1 kg of oxygen is heated from 20 to 120°C. Determine the amount of heat transfer required when this is done during a (a) constan
    7·1 answer
  • A rigid vessel with a volume of 10 m3 contains a water-vapor mixture at 400 kPa. If the quality is 60 percent, find the mass. Th
    11·1 answer
  • 2. The unthreaded part of a bolt or screw is called the
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!