Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask Java Expert


Home >> Java

Complete the following exercises:

1) prepare a function that uses recursion that converts a decimal number to octal (base 8). The function should accept a single integer and return a String containing the base 8 equivalent.

2) prepare a recursive function that implement the following functions:

a)  x0 = 1
xn = x * xn-1 if n > 0

b) x0 = 1
xn = (xn/2)2 if n > 0 and n is even
xn = x * (xn/2)2 if n> 0 and n is odd

3) How many multiplications will the functions you wrote in problem 2 perform when computing 319? 332?
How many recursive calls will the functions make when computing 319? 332?

4) prepare a recursive function that implements the following function:
f(1) = 1; f(2) = 1; f(3) = 1; f(4) = 3; f(5) = 5
f(n) = f(n-1) + 3 * f(n-5) for all n > 5

Make the function as efficient as possible.

5) Compute f(n) for n = 6, 7, 12, 15

Java, Programming

  • Category:- Java
  • Reference No.:- M9995

Have any Question? 


Related Questions in Java

Learning outcomes1use different program control statements

Learning Outcomes: 1. Use different program control statements in a programming language 2. Demonstrate the use of arrays with a programming language 3. Define and work with classes and objects in a programming language. ...

Assignmentbullusing html css and javascript design a

Assignment • Using HTML, CSS and JavaScript. Design a webpage with the following: • The design of all Web pages in the site must include: o a header at the top of the page, o a horizontal navigation bar below the header, ...

Modify the week two java application using netbeans ide to

Modify the Week Two Java application using NetBeans IDE to meet these additional and changed business requirements: The company has recently changed its total annual compensation policy to improve sales. A salesperson wi ...

Write a java program that prints asks the user to enter a

Write a Java program that prints asks the user to enter a positive value (1 less than or equal to 200) and print each number up to that line, 1 per line with the following changes (SNAP CRACKLE POP). • If a number is *** ...

Assignmentthis assignment will give you a chance to

Assignment This assignment will give you a chance to exercise your knowledge of extending jQuery and of multimedia players like the JWPlayer. We're building on the "divide-text-into-spans" example we started in Homework ...

Assignment introduction to web developmentwhen you see

Assignment: Introduction to Web Development When you see "Richard Ricardo" in the example screen captures, change it to . If you do not put / in the above mentioned fields, you will get 0 points for the question(s). No t ...

Assignmentmust be done on bluejin this exercise you will

Assignment MUST BE DONE ON BLUEJ In this exercise you will create a simple VotingMachine. In the United States, when a candidate runs for office, the person is often identified as a Democrat, Republican, or Independent. ...

Spell checker in python and javawrite a python code and

Spell checker in python and java Write a python code and java code that can take a whole sentence and do text analysis by checking the spelling mistakes and show the correct spelling. Example: Input: I have a peen. Outpu ...

Casegreentek is a software solution company for smartphone

Case Greentek is a software solution company for smartphone and tablet devices. Current headquarter (HQ) locates in Sydney, 30 sale team members and 50 software engineers base in Singapore and Manila respective. The cycl ...

Assignmentexercise1write a java class that asks the user to

Assignment Exercise#1: Write a java class that asks the user to enter three numbers N1, N2, N3 , obtains the numbers, then calculates and displays the largest number Max followed by the text "is the largest" and the smal ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

WalMart Identification of theory and critical discussion

Drawing on the prescribed text and/or relevant academic literature, produce a paper which discusses the nature of group

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro