Homework 1


1.  You should modify the code from the factorial and combinations program to allow the user to input the overall

set size = N

subset size = K

into textFields on a GUI form using a GridBag Layout.

The program should then take these inputs and compute the factorial of N and display this result in another textField.  It should also display the number of subsets of size K, which is the number of combinations in another textField.

  1. All of these textFields should appear on the same form.

  2. You need to have a command button to press to cause the solution to execute.

  3. You need to have some code to determine whether the inputs are valid.


2.  You should modify the code for the Complex numbers so that you have a GUI using a GridBag Layout. 

  1. The user should be able to input two different complex numbers on the same form.

    • think before you leap

  2. When the user presses a button the program should determine the sum, difference and product of these two numbers.

  3. It should display each of these results on the form in a fashion that will be readily interpretable by a user.