Note that you can only use recursion to solve Q1  and you cannot use any loop. You are free to add helper methods, but you are not allowed to change the method header. Question 1: Crazy series

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Note that you can only use recursion to solve Q1  and you cannot use any loop. You are free to add helper methods, but you are not allowed to change the method header.
Question 1: Crazy series
In this session, you need to implement the crazy series method. In the crazy series, you will be given a 
starting number. Then, you need to times 2 for each number until the number is greater than 100. After 
the number is greater than 100, you need to divide 3 until we reach the number is less than 5. Note that 
the input number must be greater than 0, and you are not allowed to use loop here.
For example,
crazySeries(10) should return ArrayList [10.0, 20.0, 40.0, 80.0, 160.0, 
53.333333333333336, 17.77777777777778, 5.9259259259259265, 1.9753086419753088]
crazySeries(5) should return ArrayList [5.0, 10.0, 20.0, 40.0, 80.0, 160.0, 
53.333333333333336, 17.77777777777778, 5.9259259259259265, 1.9753086419753088]
crazySeries(1) should return ArrayList [1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0, 
42.666666666666664, 14.222222222222221, 4.7407407407407405] 

Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Computational Systems
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education