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
ohaa [14]
3 years ago
8

Write a recursive method, numToString, that takes two arguments: num, the number to convert, and base, the base to represent the

number in. For instance, calling numToString(10, 2) returns the decimal number 10 as the base-two (binary) string "1010". Your method should work with any base 2 <= base <= 36. g
Computers and Technology
1 answer:
AnnyKZ [126]3 years ago
6 0

Answer:

This is the required code:

Explanation:

public class NumberToString {

   public static String numToString(int num, int base) {

       final String digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";

       if (num < base) {

           return "" + digits.charAt(num);

       } else {

           return numToString(num / base, base) + digits.charAt(num % base);

       }

   }

}

You might be interested in
17.8.1: Writing a recursive math function. Write code to complete raise_to_power(). Note: This example is for practicing recursi
Yuliya22 [10]

Answer:

The recursion function is as follows:

def raise_to_power(num, power):

if power == 0:

 return 1

elif power == 1:

 return num

else:

 return (num*raise_to_power(num, power-1))

Explanation:

This defines the function

def raise_to_power(num, power):

If power is 0, this returns 1

if power == 0:

 return 1

If power is 1, this returns num

elif power == 1:

 return num

If otherwise, it calculates the power recursively

else:

 return (num*raise_to_power(num, power-1))

6 0
3 years ago
What are some of the functions in the Consolidate dialog box? Check all that apply.
goblinko [34]

Answer:

sum average and count is the answer

5 0
3 years ago
Dereck works for long hours on his computer. He frequently experiences physical strain by the end of the day because he does not
Anni [7]
I think the answers are B and D!
4 0
3 years ago
Read 2 more answers
Tumblr, Jaiku is an example of _____________ website.
adelina 88 [10]

Answer:

<h3><u>Microblogging </u></h3>

  • <u>One of the best-known channels in the microblogging world. Twitter is a quick and convenient way to share short posts, GIFs, article links, videos and more. Pinterest: Companies on Pinterest link to products, articles and other useful information for </u><u>audiences </u><u>.</u>

Explanation:

<h2>Hope this helps you !! </h2>
3 0
2 years ago
Sincerely is an example of a salutation true or false
Setler79 [48]
No, I don't think so.
5 0
3 years ago
Read 2 more answers
Other questions:
  • Where does the VLookup function find its lookup values?
    14·1 answer
  • Use the image above to determine which toolbars will be displayed in the program you are using. SELECT ALL THAT APPLY
    11·2 answers
  • . char values are surrounded by _____ quotes
    15·1 answer
  • How many electrons are there in an atom of carbon? A. Four B. Eight C. Six D. One
    15·2 answers
  • How does the access point know whether a wireless data packet is intended for its network?
    14·1 answer
  • The entirety of a packet at one Layer becoming the payload section at another is know as?
    11·2 answers
  • In Windows 7's Jump List, what can we do?
    6·1 answer
  • Which programming language was released first? FORTRAN BASIC Perl Pascal<br><br>ANSWER: FORTRAN (A)
    9·2 answers
  • Compare and contrast hardware and software.
    11·2 answers
  • You can use a(n) ______________to store large amounts of customer data for a website.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!