Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Develop working Java code to exercise techniques related to the topic, and answer some written response questions The Topic is Recursion 5 Java Programming Steps

Develop working Java code to exercise techniques related to the topic, and answer some written response questions
The Topic is Recursion
5 Java Programming Steps
Note: It is a Java requirement to name your public Java class the same as the filename
To assist with efficient scoring, implement the code steps below in the order shown in this writeup
Develop a Java class that meets the following requirements
1. Include javadoc comments for the class and each method. Include identification of the author and one sentence description in the class comment. Use the javadoc command to generate documentation files for your program and include them in the submission in a zip file See the references section
2. Define a private array data field to hold data of hold some data of a type relevant to your career interests. Youll Use this data field in your recursive demonstration method below Try the private visibility modifier keyword.
3. Implement a setter method that sets the value of the above data field (described in step 2) using the value from the method parameter.
4. Implement a getter method that returns the value of the above data field (described in step 2). This allows outside code to get access to the value
5. Choose one of the following three options for how to process the data in your data field 2: 1) print, 2) add all or 3) multiply all. Then, implement a method that recursively processes the data field data according to your choice For example, if you chose to print, one value in the array would be printed for each recursive call. Use recursive calls to accumulate, so that one call contributes one value to the result
6. Implement a main method that demonstrates calling the above methods and prints any result: Recall: any java program must have a public static main method
(a) Create an object of your class demonstrator type
(b) Set the objects private data field using your setter method
(c) Get the objects data field value using the getter method, and print its full contents to the screen
(d) Finally, pass it into a call to your recursive accumulating method (described in step 5) and print any result.
Written Response Questions
1. Explain your own example of a real-world problem or system, that is relevant to your own location and life, that can be recursively defined. Also explain what the base case would be for your problem A recursive problem reappears within itself as smaller versions of itself, and solving the overall problem can be done by solving the subproblems within it the same way as solving the overall problem.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL/PHP Database Applications

Authors: Jay Greenspan, Brad Bulger

1st Edition

ISBN: 978-0764535376

More Books

Students also viewed these Databases questions