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
How do you go about inserting additional worksheets into a workbook?
kicyunya [14]
The correct answer is D. All of the methods listed above are ways of inserting new sheets into a workbook.
6 0
3 years ago
Which code snippet could be used to print the following series?
GaryK [48]
C is the answer, I think
7 0
1 year ago
Ano ang word processor at electronic spreadsheet​
AveGali [126]

Answer:

excel

Explanation:

3 0
3 years ago
Read 2 more answers
We need goku and naruto fight story someone
lana [24]

Answer:

goku comes in and turns super sayain  naruto come in with kurama and naruto get goku with a rasagen and geku is still fist fightin while naruto is using his kurama and turns into kurama and knocks out goku now naruto thinks he won and goku IS HITIN HIM WITH A KAMEKAMEHA GOKU IS SIROUS NOW

Explanation:

8 0
3 years ago
Read 2 more answers
Question 6 [10 marks] a) How does a company's use of information systems affect its corporate strategies? (7 marks) b) Provide a
Alja [10]

Answer:

following are the responses to the given question.

Explanation:

The capability to successfully utilize IT is mutually dependent on its ability to execute strategic strategy and set business goals. The ability to compete more and more relies on the capacity of an organization of using technology. In the future, what a company wants to do will rely on what its technologies can do. It may be an example of a company investing in information technology that allows a company to manufacture new products or improve the efficiency of the distribution system to the corporation's economic efficiency.

5 0
3 years ago
Other questions:
  • String word = “Awesome”;
    9·2 answers
  • 6. A distribution consists of three components with frequencies 200, 250 and 300 having means
    14·1 answer
  • Suppose the file is sent continuously as one big message. how long does it take to send the file, assuming it is sent continuous
    15·1 answer
  • A small, electronic chip that a manufacturer develops for use in another product (such as a digital camera or microwave oven) is
    11·2 answers
  • Assume that a variable variable, number Of Sides has been initialized. Write a statement that assigns the value True to the vari
    8·1 answer
  • The overall visual look of a chart in terms of its graphic effects, colors, and backgrounds is the:
    5·1 answer
  • What is the root of the tree?
    6·1 answer
  • In the cis configuration, the methyl groups are placed _____.
    8·2 answers
  • Command create database in oracle database ::((
    8·1 answer
  • Which of the following is Microsoft Windows 10 virtualization technology?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!