Week5_Assignment

Week5_Assignment - TextField s. Display the result of gcd...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Programming Assignment 6 The greatest common divisor (GCD) of two integers is the largest integer that evenly divides each of the two numbers. For example, the greatest common divisor of 12 and 18 is 6. Write a method titled gcd that accepts two integers (as input parameters to the method), and returns the greatest common divisor of the two integers. Incorporate the method into an applet that obtains two integers from the user using
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: TextField s. Display the result of gcd in the status bar , and on the applet window . Run multiple tests, and submit a complete .java printout, and a display of multiple windows that clearly demonstrates that your applet works. An aside, it makes good sense to call the gcd method at the point you are preparing your output message. You should not call gcd from your actionPerformed method....
View Full Document

This note was uploaded on 10/12/2009 for the course CS 120 taught by Professor Robertdependahl during the Fall '09 term at Santa Barbara City.

Ask a homework question - tutors are online