AP Computer Science --- Haas --- GCFStatic
Objective: Modify your GCF program to make its methods static.
Add new methods to find the GCF of 3 integers.
The class GCF will now have the following methods (all static).
- int getGCF(int num1, int num2) - a method which takes two integer parameters and
returns the GCF.
- void printGCF(int num1, int num2) - a method which takes two integer parameters
and prints the two numbers and the GCF
- int getGCF(int x, int y, int z) - write a new method which takes three integer
parameters and returns the GCF.
- void printGCF(int x, int y, int z) - write a new method which takes three integer
parameters and prints the numbers and the GCF
Modify your tester program to test the new static version of GCF