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
Choose the true statement from those shown below: A Merchant Account allows you to use SSL on your web site. Disadvantages of us
Slav-nsk [51]

Answer:

The answer is A. that is, a merchant account allows you to use SSL on your website.

Explanation:

SSL means Secure Sockets Layer and this is an encryption-based Internet security protocol.

For an e-commerce merchant website or account, it is advised that an SSL package be installed to prevent any potential loss of private information.

For this reason, a merchant account allows use of SSL on your website because this also boost the confidence of client and customers visiting the website to purchase products.

7 0
3 years ago
What are employers required to do to keep employees safe from caught-in and -between hazards from hand-held power tools?
nika2105 [10]

Answer:

Employees who use hand and power tools and who are exposed to the hazards of falling, flying, abrasive and splashing objects, or exposed to harmful dusts, fumes, mists, vapors, or gases must be provided with the appropriate equipment needed, including Personal Protective Equipment, to protect them from the hazard.

Explanation:

8 0
3 years ago
A rod that was originally 100-cm-long experiences a strain of 82%. What is the new length of the rod?
Ierofanga [76]

Answer: (b)

Explanation:

Given

Original length of the rod is L=100\ cm

Strain experienced is \epsilon=82\%=0.82

Strain is the ratio of the change in length to the original length

\Rightarrow \epsilon =\dfrac{\Delta L}{L}\\\\\Rightarrow 0.82=\dfrac{\Delta L}{100}\\\\\Rightarrow \Delta L=82\ cm

Therefore, new length is given by (Considering the load is tensile in nature)

\Rightarrow L'=\Delta L+L\\\Rightarrow L'=82+100=182\ cm

Thus, option (b) is correct.

8 0
3 years ago
Roku internet service providet​
podryga [215]

Answer:

What?? I do not understand?

6 0
3 years ago
A 50000 N plane has wings with a span of 30 m and a chord of 6 m. How much cargo can this plane carry while cruising at 550 km/h
soldi70 [24.7K]

Answer:

The amount of cargo the plane can carry is 8707.89 N

Explanation:

The surface area of the wings facing the air = 30×6×2 × sin(2.5) = 15.7 m²

The speed of the plane 550 km/h = 152.78 m/s

The volume of air cut through per second = 15.7 × 152.78 = 2399.07 m³

The mass of air = Volume × Density = 2399.07 × 0.37 = 887.65 kg

Weight of air = Mass × Acceleration due to gravity = 887.65 × 9.81 = 8707.89 N

Given that the plane is already airborne, the additional cargo the plane can carry is given by the available lift force of the plane.

The amount of cargo the plane can carry = 8707.89 N

8 0
4 years ago
Other questions:
  • A sharpshooter can hit the target with a probability p=0.75. a) What is the probability that out of 10 shots she misses them all
    10·1 answer
  • You’re engineering an energy-efficient house that will require an average of 6.85 kW to heat on cold winter days. You’ve designe
    13·1 answer
  • Determine whether or not each of the following signals is periodic.
    11·1 answer
  • The volume of a cylinder is to be determined from measurements of the diameter and length. If the length and diameter are measur
    11·1 answer
  • Which of the following reveals the most common obstacle that engineers must overcome?
    11·2 answers
  • A tensile load of 6.9 kN is applied on a copper rod with diameter of 12 mm. (a) What is the maximum normal stress in the rod? (b
    12·1 answer
  • Gypsum is the main component in drywall (also called sheetrock and wallboard). Drywall is used extensively in the interior of mo
    14·1 answer
  • How long...you...novels? A. Have/write B. Do/write C. Have/written D. Did/go
    8·2 answers
  • which acpi power state allows a system to start where it left off, but all other components are turned off? sleeping mechanical
    13·1 answer
  • A motor car shaft consists of a steel tube 30 mm internal diameter and 4 mm thick. The engine develops 10 kW at 2000 r.p.m. Find
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!