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 need someone to transfer this into a database in excel Please help :D 7 pts
sergejj [24]
What kind of database?
6 0
2 years ago
I am trying to make a flowgorithm chart for a dogs name, age, weight and when their weight is less than 50 OR more than 100 its
kumpel [21]

Answer:

i think it helps

Explanation:

sorry there was someone else rude as heck messaging and responding I couldn't see their screen name

what isig naame

oh okay

I have sent dm

i dont know your name there

5 0
2 years ago
If it can be applied, the least-damaging recovery option is ________.
Fed [463]
The answer is D, I believe.

6 0
3 years ago
On many advanced routers and switches, you can implement QoS through bandwidth management, such as __________, where you control
Mila [183]

Answer:

c. traffic shaping

Explanation:

A traffic shaping system is one that allows to adapt the incoming data traffic that comes from some node of the network giving it a special treatment called conformation of accepted traffic and thus allowing the frames to be forwarded through the network of data under traffic rules without having gone through some traffic shaping method, this can be detected as non-conforming traffic at the edge of access to the discarded metropolitan network.

Traffic shaping is a mechanism that alters the traffic characteristics of the cell flow of a connection to achieve better network efficiency while maintaining QoS objectives or in order to ensure that the cell flow conforms to traffic parameters according to the leaky bucket algorithm configuration of the traffic contract. Traffic shaping can be used in ATM, for example, to reduce peak speed, limit the length of the burst by means of adequate spacing of cells over time. The use and location of this function is network specific.

5 0
2 years ago
Binary is a base-2 number system instead of the decimal (base-10) system we are familiar with. Write a recursive function PrintI
Paladinen [302]

Answer:

In C++:

int PrintInBinary(int num){

if (num == 0)  

 return 0;  

else

 return (num % 2 + 10 * PrintInBinary(num / 2));

}

Explanation:

This defines the PrintInBinary function

int PrintInBinary(int num){

This returns 0 is num is 0 or num has been reduced to 0

<em> if (num == 0)  </em>

<em>  return 0;  </em>

If otherwise, see below for further explanation

<em> else </em>

<em>  return (num % 2 + 10 * PrintInBinary(num / 2)); </em>

}

----------------------------------------------------------------------------------------

num % 2 + 10 * PrintInBinary(num / 2)

The above can be split into:

num % 2 and + 10 * PrintInBinary(num / 2)

Assume num is 35.

num % 2 = 1

10 * PrintInBinary(num / 2) => 10 * PrintInBinary(17)

17 will be passed to the function (recursively).

This process will continue until num is 0

7 0
3 years ago
Other questions:
  • Wich of these is an example of magnetic storage
    11·1 answer
  • Write a C program that has the following statements: int a, b; a = 10; b = a + fun(); printf("With the function call on the righ
    12·1 answer
  • In modern computer memory, each location is normally composed of one byte.
    7·1 answer
  • Explain the nature of documents that can be suitable for mergin
    12·1 answer
  • Strong emotions can interfere with your ability to
    15·1 answer
  • Which is the correct sequence of steps for opening a new document?
    10·2 answers
  • Which of the following feature are parts of Toyota’s safety system?
    10·1 answer
  • Difference between positional and non positional number​
    12·1 answer
  • 9. Select the correct answer.
    6·1 answer
  • Which of the following could be a method for an object-oriented class called Student?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!