Computer scientists and mathematicians often use numbering


1. Write and test a recursive function max to find the largest number in a list. The max is the larger of the first item and the max of all the other items.

2. Computer scientists and mathematicians often use numbering systems other than base 10. Write a program that allows a user to enter a number and a base and then prints out the digits of the number in the new base. Use a recursive function baseConversion(num,base) to print the digits.

Hint: Consider base 10. To get the rightmost digit of a base 10 number, simply look at the remainder after dividing by 10. For example, 153%10 is 3. To get the remaining digits, you repeat the process on 15, which is just 153/10. This same process works for any base. The only problem is that we get the digits in reverse order (right to left).

Write a recursive function that first prints the digits of num//base and then prints the last digit, namely num%base. You should put a space between successive digits, since bases greater than 10 will print out with multi-character digits. For example, baseConversion(245, 16) should print 15 5.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Computer scientists and mathematicians often use numbering
Reference No:- TGS01704939

Expected delivery within 24 Hours