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, 21.06.2019 17:20
When developing a stakeholder matrix, the portfolio manager must look at the portfolio governance in order to complete the stakeholder analysis. in your own words, what is the role, interest and expectations of the governance?
Answers: 3
question
Computers and Technology, 22.06.2019 18:00
Suppose an astronomer discovers a large, spherical-shaped body orbiting the sun. the body is composed mostly of rock, and there are no other bodies sharing its orbit. what is the best way to categorize this body? a. planet b. moon c. comet d. asteroid
Answers: 1
question
Computers and Technology, 22.06.2019 19:00
In he example code, what does the title attribute create? a tool tip an element a source a markup
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
Amanda needs to create an informative print brochure for her local library’s fundraiser dinner. what critical detail must she have before she starts designing the brochure?
Answers: 1
You know the right answer?
Recursive Programming Problem

Write a JAVA program that repeatedly prompts your user for...
Questions
question
Biology, 20.11.2020 20:40
question
Biology, 20.11.2020 20:40
question
Arts, 20.11.2020 20:40
question
Mathematics, 20.11.2020 20:40
question
Mathematics, 20.11.2020 20:40
question
Mathematics, 20.11.2020 20:40
question
Mathematics, 20.11.2020 20:40
question
Mathematics, 20.11.2020 20:40
question
Mathematics, 20.11.2020 20:40
Questions on the website: 13722361