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
Which function of InfoSec management encompasses security personnel as well as aspects of the SETA program?
inessss [21]

Answer:

People

Explanation:

Information security management provides a description of the controls needed by an organization in order to ensure that it is capable of protecting the integrity, availability, and confidentiality of assets from security vulnerability and threats. On the other hand, the SETA program is three phased and ensures that organizations address and implement training and techniques for information security. Hence the only function that encompasses security personnel as well as aspects of the SETA program is the People function.

8 0
4 years ago
HOW DO I HACK PUBG MOBILE WITH PROOF <br>GIVE ME LINK​
muminat

Answer:

why do u want to do that i have an acc i dont even use that is so good with so much uc and other skins on it

Explanation:

5 0
3 years ago
Read 2 more answers
Which is most likely to cause confusion, hinder thinking, and prevent quick access to resources in a study environment? phones c
OverLord2011 [107]
Clutter will cause the most problems when you are trying to study because <span>If you’re unable to get through the material clogging up your </span>neural<span> networks, so the theory goes, you’ll be slower and less efficient in processing information. As a result, you’ll be incapacitated when it comes to short-term memory tasks, and even in longer-range mental exercises when you have to come up with information you should know, such as names of people, that you can no longer find within your disorganized repository of knowledge.

Hope this helps, 

kwrob</span>
3 0
4 years ago
Read 2 more answers
Which of the below statements describes the nature of HTML elements - check as many as apply
slava [35]

Answer:

The answer to this question is option 1,2 and 4.

Explanation:

Some html elements does not contain anything or having no content are called empty html elements.for ex:- <br>,<hr> etc.

HTML elements are of two types block and inline.block elements starts with new line for ex:-div,body etc.Inline elements does not starts with new line.for ex:-<style>,<meta>,<head>etc.

Html elements also contains attributes that modify the element for ex:-

<body style="background-color:blue;">

where style is an attribute.

5 0
3 years ago
personalization allows customers to modify the standard offering, such as selecting a different home page to be displayed each t
shusha [124]
True, personalization is definitely part of this.
6 0
2 years ago
Other questions:
  • Write a program whose input is two integers and whose output is the two integers swapped. Place the values in an array, where x
    12·1 answer
  • Two columns of a relational table can have the same names. <br> a. True <br> b. False
    15·1 answer
  • Explain the design and development proccess?
    15·1 answer
  • Sally needs to copy data from the first worksheet to the fifth worksheet in her workbook. Which combination of keys will she use
    11·2 answers
  • What is the term for a combination of user name and domain name that identifies a user so he or she can receive Internet email?
    6·1 answer
  • All of the following statements about logistics information systems (LIS) are true except ________.
    14·1 answer
  • Using the spreadsheet below, which formula can be used to determine Albert's hourly wage?
    6·2 answers
  • What is the capital of Peru?<br> A. <br> Brazil<br> B. <br> Lima<br> C. <br> Inca
    11·2 answers
  • Ano ang dalawang paraan sa paggawa ng abono?​
    6·1 answer
  • Which clue can be used to identify a chemical reaction as a combustion reaction?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!