Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Java- Data Structures and Analysis

Prefered Netbeans

Question 1

a) Design and implement a recursive method convert1 which takes two parameters: a positive integer number n (in base 10) and a positive integer number b between 2 and 9 inclusively. The method should return the number in base b which corresponds to the decimal number n. For example, convert1(19, 8) should return 23. It means that 19 in base 10 correspond to 23 in base 8. Hint. Note that n / 10 is an integer obtained by dropping the rightmost digit of n while n % 10 is the rightmost digit of n.

b) Design and implement a recursive method convert2 which takes two parameters: an integer b between 2 and 9 and a String n representing a numeric value in base b. The method should return an int value representing the decimal value of n. For example convert2 ("11101", 2) should return 29.

c) Design and implement TestQ1.java a Swing based GUI driver program to test the methods convert1 and convert2.

Question 2

Consider an array of size 20 fully populated with non-duplicated, random generated, unsorted integer values in the range -99..99.

a) Design and implement a recursive method findValueUnsortedArray which takes two parameters: an unsorted array of integer values and an integer value which is looked for in the array. The method returns the array index of the value being searched for if the value is in the array and -1 if the value is not in the array. The method should be splitting the array in two halves looking for the value in each of the two halves and so on ... until it gets to individual values that can be compared to the value which is searched for.

b) Using the Binary Search Method, design and implement a recursive method findValueSortedArray with the same signature and return value as the method findValueUnsortedArray.

c) What is the Big-O complexity of the two methods? Explain why they are different.

d) Design and implement TestQ2.java a driver program to test the methods findValueUnsortedArray and findValueSortedArray. Consider an array of size 20 initially populated with non-duplicated integer values.

Submission requirements

Submit the following before the due date listed in the Calendar:

1. The source files TestQ1.java and TestQ2.java. These source files should also include the required recursive methods. The source code should use Java code conventions and professional code layout regarding white space management, indents and comments.

2. The Solution description document _HW3 (.pdf or .doc / .docx) containing: (2.1) assumptions, main design decisions, error handling; (2.2) test cases and two relevant screenshots; (2.3) the answer and explanation required by question 2c); (2.4) lessons learned and (2.5) possible improvements. The size of the document file (including the screenshots) should be of two pages, single spaced, font size 10.

Requirements:

Design:

Employs Modularity (including proper use of parameters, use of local variables etc.) most of the time.

Employs correct & appropriate use of programming structures (loops, conditionals, classes etc.) most of the time.

Efficient algorithms used most of the time.

Excellent use of object-oriented design.

Functionality:

Program fulfills all functionality.

All requirements were fulfilled.

Extra effort was apparent.

Test Plan:

Comprehensive test plan.

Documentation:

Excellent comments.

Comprehensive lessons learned.

Excellent possible improvements included.

Excellent approach discussion and references.

Java, Programming

  • Category:- Java
  • Reference No.:- M91836953

Have any Question?


Related Questions in Java

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

Operating systems assignment -problem 1 sharing the bridgea

Operating Systems Assignment - Problem 1: Sharing the Bridge A new single lane bridge is constructed to connect the North Island of New Zealand to the South Island of New Zealand. Farmers from each island use the bridge ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Simple order processing systemquestion given the classes

Simple Order Processing System Question: Given the classes Ship (with getter and setter), Speedboat, and SpeedboatTest. Answer the following questions: Refine the whole application (all classes) and create Abstract class ...

Assignment - method in our madnessthe emphasis for this

Assignment - "Method in our Madness" The emphasis for this assignment is methods with parameters. In preparation for this assignment, create a folder called Assign_3 for the DrJava projects for the assignment. A Cityscap ...

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Answer the following question whats the difference public

Answer the following Question : What's the difference public inheritance and private inheritance? What can derived classes inherit from base classes? What cannot be inherited from base classes?

In ruby the hash class inherits from enumerable suggesting

In Ruby, the Hash class inherits from Enumerable, suggesting to a programmer that Hashes are collections. In Java, however, the Map classes are not part of the JCF (Java Collections Framework). For each language, provide ...

Can someone kindly help me to consider whether java

Can someone kindly help me to consider whether Java provides the facility of operator overloading? If it does, may you kindly describe how overloading operators can be accomplished? If not, may you kindly describe why yo ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As