Using recursion determine the number of tribble for any hour

Assignment Help Computer Engineering
Reference no: EM132076133

You need help in JAVA figuring out how to match my inputed hour value with an array of set values. You can make everything work from there. Here is the problem You are looking at, and below that is my code thus far. Any pointers or suggestions would be greatly appreciated.

Problem

You think rabbits breed quickly? Tribbles are worse by far! Dr. McCoy of the Enterprise is trying to determine how many tribbles are there going to be every hour. Now, he suspects that they are born pregnant with one baby-tribble (which saves a lot of time when you think about it) that is born within the first hour. His empirical research has identified these amount of tribbles alive at each hour:

2          2          2          6          10        18        34        62        114      210

Using this sequence, write a JAVA program that uses recursion to determine the number of tribble for any hour. It should prompt the user for the hour and then display the total tribbles.

Reference no: EM132076133

Questions Cloud

Create a gui application for a pizzeria : Extra Large ($14) The user may also choose any number of toppings at a cost of $1.00 per topping.
Construct a contour diagram : Construct a contour diagram for z=e^(x-y^2-1) with two level curves. show your steps
Critical points of f as either saddle : Find and classify all critical points of f as either saddle, local min or local max.
Creates an array capable of holding four shape objects : Create two subclasses of Shape: Circle and Square. Then, you should write a driver program with a main method .
Using recursion determine the number of tribble for any hour : Write a JAVA program that uses recursion to determine the number of tribble for any hour.
Write three overloaded methods that calculate averages : The first method takes two integer parameters, the second takes three integer parameters, and the third takes four integer parameters.
Write a recursive function called sumdigits : Write a recursive function called sumDigits with the following signature: public static long sumDigits(long n).
Create a package named reading_with_exceptions : Create a package named "reading_with_exceptions". Write a class named: Reading_With_Exceptions with the following method.
Find the work done hoisting : Find the work done hoisting a 1,500 pound generator 50 feet straight up into the air. Assume the force of gravity is acting straight downwards

Reviews

Write a Review

Computer Engineering Questions & Answers

  The readings for this week mention six stages of the

the readings for this week mention six stages of the systems development life cycle. there are other models however

  While working with the it and clinical departments you are

while working with the it and clinical departments you are assisting them in creating a drop-down menu for the

  Discuss design principles to consider in designing displays

Discuss some of the design principles to consider in designing auditory displays.

  List some of practical applications that are representable

List some of the practical applications that are representable in terms of the coloring problem.

  Develop a prototype using a scripting language such as ruby

Develop a prototype using a scripting language, such as Ruby or Python, evaluate this prototype with software engineers and other stakeholders, then review the system requirements. Redevelop the final system using Java.

  Build a java application that prompts a user for a full name

Write another Java application that accepts a user's password from the keyboard. When the entered password is less than six characters, more than 10 characters, or does not contain as a minimum one letter and one digit, prompt the user again.

  Why organizations need risk and control self-assessment

Discuss why organizations need risk and control self-assessment (RCSA) policies and why are they important

  A word document with another office-type document

A compound document within Microsoft Office usually consists of a Word document with another office-type document (i.e. Excel, PowerPoint slideshow, etc.) within the Word document.

  Determine the rate of heat loss from all surfaces of tank

A 40-cm-diameter, 110-cm-high cylindrical hot water tank is located in the bathroom of a house maintained at 20°C.

  Make program to gauge the expected cost of an item

It is tough to make a budget that spans several years, because prices are not stable. If your company needs 200 pencils per year, you cannot simply use this year's price as the price of pencils two years from now. Because of inflation the cost is ..

  Extend the vector-adt package to include less than operator

Extend the Vector_ADT package to include a negation operator ("-") function that return a vector. Extend the Vector_ADT package to include a less than operator.

  Define between erp configuration and customization

How does this guide or limit the scope of an enterprise system implementation project.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd