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
USPshnik [31]
3 years ago
5

Write a recursive method that receives a string as a parameter and recursively capitalizes each character in the string (change

a small cap to a large cap, e.g. a to A, b to B, etc) as following: capitalize the first letter from the string, then calls the function recursively for the remainder of the string and in the end, build the capitalized string. For example, for "java", will capitalize the first letter to "J"(base case), calls the method recursively for the reminder of the string "ava" (reduction), and after recursion/reduction is over it and returns "AVA" will build a new string from "J" and "AVA" and return "JAVA" to the calling method.
Write this algorithms in java source code plz.
Computers and Technology
1 answer:
Alexxandr [17]3 years ago
4 0

Answer:

String words[]=str.split("\\s");  

String capitalizeWord="";  

for(String w:words){  

   String first=w.substring(0,1);  

   String afterfirst=w.substring(1);  

   capitalizeWord+=first.toUpperCase()+afterfirst+" ";  

}  

return capitalizeWord.trim();  

Explanation:

Define the word you are trying to capitalize and split it into an array.

String words[]=str.split("\\s");

Create a string for the capital output to be created as

String capitalizeWord="";  

Capitalize the word using the "first.toUpperCase()" and "afterfirst" functions

for(String w:words){  

   String first=w.substring(0,1);  

   String afterfirst=w.substring(1);  

   capitalizeWord+=first.toUpperCase()+afterfirst+" ";  

}  

You might be interested in
I'm getting an iphone xr today. what should i do 1st? Any cool fetures? i have a iphone 6 now so its a pretty big upgrade
Sonja [21]

Answer:

I wouldn't get an iphone xr my stepmom had one and the screen started having problems and the apps were glitching.

8 0
2 years ago
Read 2 more answers
Determina la cilindrada total Vt en un motor de 4 cilindres de 83,6 mm de diàmetre per 91 mm de cursa.
insens350 [35]

Answer:

La cilindrada total del motor es de 1997,025 centímetros cúbicos.

Explanation:

Para determinar la cilindrada total Vt en un motor de 4 cilindros de 83,6 mm de diámetro por 91 mm de carrera se debe realizar el siguiente cálculo, sabiendo que para calcular la cilindrada de un motor se debe utilizar la fórmula ((Pi x Diámetro^2)/4) x Carrera x Número de cilindros = X:

((3.14 x 83.6^2)/4) x 91 x 4 = X

((3.14 x 6,988.96)/4) x 364 = X

(21,945.3344 / 4) x 364 = X

5,486.3336 x 364 = X

1,997,025.4304 = X

1 milímetro cúbico = 0.001 centímetro cúbico

1,997,025.4304 milímetros cúbicos = 1997.0254304000005 centímetros cúbicos

Por lo tanto, la cilindrada total del motor es de 1997,025 centímetros cúbicos.

3 0
2 years ago
Is wireless or wired network faster??
bogdanovich [222]

Answer:

Wired

Explanation:

3 0
3 years ago
Read 2 more answers
Lionbridge theory test
marishachu [46]
What about it kidddddd
4 0
3 years ago
Read 2 more answers
Explain what mistake Miranda made in the following scenario. Situation: Miranda suspects that there may be a problem with the ha
Dennis_Churaev [7]

Answer: Answer below.

Explanation:

I'm not fully sure myself, so don't agree with me fully.

I believe what she may have done wrong is tell the technician about a "program." A program doesn't have to do anything with physical hardware.

5 0
3 years ago
Read 2 more answers
Other questions:
  • A. true
    6·1 answer
  • Which of the following is a malicious program that can replicate and spread from computer to computer?
    8·2 answers
  • Problem 3. Consider the following recurrence, defined for n a power of 4 (for the time of some algorithm): T(n) = 3 if n = 1 2T(
    5·1 answer
  • The term ____ describes primary storage devices that are implemented as microchips, can read and write with equal speed, and can
    8·1 answer
  • A production house needs an operating system that captures saves and generates information within a specific time. Which type of
    11·1 answer
  • When all the system testing and bugs correction has done, the software product will be delivered to the user for __________.
    15·1 answer
  • Which of the following images illustrates safe driving?
    8·2 answers
  • What are some applications of computer in public administration?​
    8·1 answer
  • You can't cite Wikipedia, what are three ways that you can use it for your research?
    5·1 answer
  • When working in outline mode, press __________ and click the eye icon to change only one layer back to preview mode.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!