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
Naomi needs to test an application that will be accessed by multiple users simultaneously. She is planning to use LoadRunner to
EastWind [94]
D bc i did the test and king
8 0
3 years ago
Which of the following approaches to lean engineering consists of teams of people from different departments sharing
AURORKA [14]

Answer:

PDSA, where you work as a group

Explanation:

8 0
3 years ago
Which of the following types of protective equipment protects workers who are passing by from stray sparks or metal while anothe
natima [27]

Answer:

Fire/Flame resistant clothing and aprons

Explanation:

Individuals working with or around welding equipment are usually required to wear Fire/Flame resistant clothing and aprons which are designed to protect the user from various types of hazards including heat, fires , burns , and sometimes radiation. In this scenario, it would protect the individual from the welding sparks that are produced when welding, which tends to fly all over the place and can catch fire in some cases. These clothes will prevent that from happening.

7 0
3 years ago
A solid shaft and a hollow shaft of the same material have same length and outer radius R. The inner radius of the hollow shaft
alexandr402 [8]

Answer with Explanation:

By the equation or Torque we have

\frac{T}{I_{p}}=\frac{\tau }{r}=\frac{G\theta }{L}

where

T is the torque applied on the shaft

I_{p} is the polar moment of inertia of the shaft

\tau is the shear stress developed at a distance 'r' from the center of the shaft

\theta is the angle of twist of the shaft

'G' is the modulus of rigidity of the shaft

We know that for solid shaft I_{p}=\frac{\pi R^4}{2}

For a hollow shaft I_{p}=\frac{\pi (R_o^4-R_i^4)}{2}

Since the two shafts are subjected to same torque from the relation of Torque we have

1) For solid shaft

\frac{2T}{\pi R^4}\times r=\tau _{solid}

2) For hollow shaft we have

\tau _{hollow}=\frac{2T}{\pi (R^4-0.7R^4)}\times r=\frac{2T}{\pi 0.76R^4}

Comparing the above 2 relations we see

\frac{\tau _{solid}}{\tau _{hollow}}=0.76

Similarly for angle of twist we can see

\frac{\theta _{solid}}{\theta _{hollow}}=\frac{\frac{LT}{I_{solid}}}{\frac{LT}{I_{hollow}}}=\frac{I_{hollow}}{I_{solid}}=1.316

Part b)

Strength of solid shaft = \tau _{max}=\frac{T\times R}{I_{solid}}

Weight of solid shaft =\rho \times \pi R^2\times L

Strength per unit weight of solid shaft = \frac{\tau _{max}}{W}=\frac{T\times R}{I_{solid}}\times \frac{1}{\rho \times \pi R^2\times L}=\frac{2T}{\rho \pi ^2R^5L}

Strength of hollow shaft = \tau '_{max}=\frac{T\times R}{I_{hollow}}

Weight of hollow shaft =\rho \times \pi (R^2-0.7R^2)\times L

Strength per unit weight of hollow shaft = \frac{\tau _{max}}{W}=\frac{T\times R}{I_{hollow}}\times \frac{1}{\rho \times \pi (R^2-0.7^2)\times L}=\frac{5.16T}{\rho \pi ^2R^5L}

Thus \frac{Strength/Weight _{hollow}}{Strength/Weight _{Solid}}=5.16

3 0
4 years ago
Of the following answers, which is NOT a way for employees to control exposure routes?
Katena32 [7]

Answer:  Of the following answers, which is NOT a way for employees to control exposure routes?

Explanation:

4 0
3 years ago
Other questions:
  • Rivers account for _____% of the earth's fresh water.<br> ?
    10·2 answers
  • Water at 80°F and 30 psia is heated in a chamber by mixing it with saturated water vapor at 30 psia. If both streams enter the m
    13·1 answer
  • 1. Saturated steam at 4 bars absolute pressure with a mean velocity of 3 m/s flows through a horizontal SS304 stainless-steel pi
    6·1 answer
  • Tell me a riddle and whoevers i like best gets brainliest
    6·1 answer
  • Bridge Reflection:
    10·1 answer
  • Hi shawty have a good day/night &lt;33 (heres a picture of freddie benson)
    11·2 answers
  • Fill in the correct answer.
    13·1 answer
  • A major tennis manufacturer is undertaking a test program for shoes, tennis balls, and tennis strings. Develop a test plan for t
    11·1 answer
  • Which of the following structures is most likely to have a formal risk management plan?
    14·1 answer
  • On the pavement indicate that the adjacent lane is traveling in the same direction and passing is permitted
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!