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
Plz help electrical technology
oksano4ka [1.4K]

Answer:

OPTION A,Larger

HOPE IT HELPS

8 0
3 years ago
Read 2 more answers
Determine the initial void ratio, the relative density and the unit weight (in pounds per cubic foot) of the specimens for each
Elina [12.6K]

The initial void ratio is the <em>parameter </em>which is used to show the structural foundations for each <em>specimen of sand </em>so that the method and speed of compression would be <em>measured</em>.

Relative density is the mass per unit volume of each specimen of sand which is <em>measured </em>and it has to do with the<em> relative ratio</em> of the density of the sand.

Unit weight is the the exact weight per cubic foot of the sand which is measured.

Please note that your question is incomplete so I gave you a general overview to help you better understand the concept

Read more here:

brainly.com/question/15220801

5 0
2 years ago
A series AC circuit contains a resistor, an inductor of 250 mH, a capacitor of 4.40 µF, and a source with ΔVmax = 240 V operatin
slega [8]

Answer:

Explanation:

Inductance = 250 mH = 250 / 1000 = 0.25 H

capacitance = 4.40 µF = 4.4 × 10⁻⁶ F ( µ = 10⁻⁶)

ΔVmax = 240, f frequency = 50Hz and I max = 110 mA = 110 /1000 = 0.11A

a) inductive reactance = 2πfl =  2 × 3.142 × 50 × 0.25 H =78.55 ohms

b) capacitive reactance = \frac{1}{2\pi fC} = 1 / ( 2 × 3.142× 50 × 4.4 × 10⁻⁶ ) = 723.34 ohms

c) impedance = \frac{Vmax}{Imax} = 240 / 0.11 = 2181.82 ohms

7 0
3 years ago
Read 2 more answers
For a steel alloy it has been determined that a carburizing heat treatment of 15 h duration will raise the carbon concentration
Amiraneli [1.4K]

Answer:

135 hour

Explanation:

It is given that a carburizing heat treatment of 15 hour will raise the carbon concentration by 0.35 wt% at a point of 2 mm from the surface.

We have to find the time necessary to achieve the same concentration at a 6 mm position.

we know that \frac{x_1^2}{Dt}=constant where x is distance and t is time .As the temperature is constant so D will be also constant

So \frac{x_1^2}{t}=constant

then \frac{x_1^2}{t_1}=\frac{x_2^2}{t_2} we have given x_1=2 mm\ ,t_1=15 hour\ ,x_2=6\ mm and we have to find t_2 putting all these value in equation

\frac{2^2}{15}=\frac{6^2}{t_2}

so t_2=135\ hour

5 0
3 years ago
LAB 3.3 – Working with String Input and Type CastingStep 1: RemovefindErrors.cppfrom the project and add thepercentage.cppprogra
jolli1 [7]

Answer:

// Program is written in C++ Programming Language

// Comments are used for explanatory purpose

#include<iostream>

using namespace std;

int main ()

{

// Variable declaration

string name;

int numQuestions;

int numCorrect;

double percentage;

//Prompt to enter student's first and last name

cout<<"Enter student's first and last name";

cin>>name; // this line accepts input for variable name

cout<<"Number of question on test"; //Prompt to enter number of questions on test

cin>> numQuestions; //This line accepts Input for Variable numQuestions

cout<<"Number of answers student got correct: "; // Prompt to enter number of correct answers

cin>>numCorrect; //Enter number of correct answers

percentage = numCorrect * 100 / numQuestions; // calculate percentage

cout<<name<<" "<<percentage<<"%"; // print

return 0;

}

Explanation:

The code above calculates the percentage of a student's score in a certain test.

The code is extracted from the Question and completed after extraction.

It's written in C++ programming language

4 0
3 years ago
Other questions:
  • In Florida a curb indicates and area where parking is prohibited
    15·2 answers
  • A decorative fountain was built so that water will rise to a hieght of 8 feet above the exit of the pipe. the pipe is 3/4 diamet
    5·1 answer
  • Will this airplane stay in the air a long time? Why or why not?
    9·1 answer
  • Which of the following statements about pitot-static systems is FALSE? a). A pitot probe measures the Total Pressure of the free
    10·1 answer
  • Tech A says that proper footwear may include both leather and steel-toed shoes. Tech B says that when working in the shop, you o
    15·1 answer
  • In order to lift a lighter object on the other side, a boy placed 155 N of
    6·1 answer
  • A 100-ampere resistor bank is connected to a controller with conductor insulation rated 75°C. The resistors are not used in conj
    8·1 answer
  • A skull and crossbones pictogram indicates this kind of information about a chemical.
    14·1 answer
  • Technician A says that if fuel pump pressure is correct, fuel pump volume will be correct as well. Technician B says that a fuel
    15·1 answer
  • How to clean a snowblower carburetor without removing it.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!