Write a gui program which uses a recursive method earcount


Problem Description

There are bunnies standing in a line, numbered 1, 2, ...n. The odd bunnies (1, 3, ..) have the normal 2 ears. The even bunnies (2, 4, ..) are genetic mutations and have 3 ears.

Write a GUI program which uses a recursive method, earCount(), to calculate the number of "ears" in the bunny line. The user will supply the number of bunnies in the line.

Specifications

Your program will consist of 2 Textboxes and a Button, each should be labeled appropriately. The user will enter an integer in one Textbox, press the Button, and the number of ears will be shown in the other Textbox. The second Textbox should be readonly. Do not use loops or multiplication in your program. Error Checking Inputs User input should be an integer. Give feedback if it is not and ask them to reenter. Use a Try-Catch blocks where you deem appropriate. Commenting Use the generated flower box in BlueJ to provide a description of the Class and your name.

Example: A single line comment followed by statements to create an instance of JTextField, and call setEditable method is fine. Significant variables descriptions. No "loop" variables. a, b, c, x, y, z, etc.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Write a gui program which uses a recursive method earcount
Reference No:- TGS02898359

Expected delivery within 24 Hours