subject

Recursive Programming Problem

Write a JAVA program that repeatedly prompts your user for a number, uses a recursive function to calculate the product of that number times three (3), and displays the product. Select a sentinel value that allows your user to quit. Do NOT use the multiplication operator (*) in your proposed solution.

User Inputs Recursive Function Returns
-2 -6
-1 -3
0 0
1 3
2 6
3 9
4 12
Hint: Think of multiplication as a series of additions.

User Inputs Performs Returns
1 3 3
2 3 + 3 6
3 3 + 3 + 3 9
4 3 + 3 + 3 + 3 12

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 12:00
What type of slide show is a dynamic and eye-catching way to familiarize potential customers with what your company has to offer? a. ole b. photo album c. brochure d. office clipboard
Answers: 2
question
Computers and Technology, 23.06.2019 17:00
1. which of the following is not an example of an objective question? a. multiple choice. b. essay. c. true/false. d. matching 2. why is it important to recognize the key word in the essay question? a. it will provide the answer to the essay. b. it will show you a friend's answer. c. it will provide you time to look for the answer. d. it will guide you on which kind of answer is required.
Answers: 1
question
Computers and Technology, 24.06.2019 08:00
How can smart devices benefit businesses, organizations, and social communities in the global marketplace?
Answers: 1
question
Computers and Technology, 24.06.2019 20:50
Which key function of a business involves finding, targeting, attracting, and connecting with the right customers?
Answers: 3
You know the right answer?
Recursive Programming Problem

Write a JAVA program that repeatedly prompts your user for...
Questions
question
Spanish, 11.11.2020 08:50
question
Social Studies, 11.11.2020 08:50
question
English, 11.11.2020 08:50
question
Biology, 11.11.2020 08:50
question
Spanish, 11.11.2020 08:50
question
Mathematics, 11.11.2020 08:50
Questions on the website: 13722360