This is my program so far. it is giving me one error in the second method for math with the max. and i do not know what to do. and also it gave me an error that it can't resolve the "." in JOptionPane.showMessageDialog after the math method. i just didn't put it in. I appreciate any help, cause i am clueless.
Code:import javax.swing.JOptionPane; public class program4 { public static void main(String args[]) { int x; int y; int z; String one; String two; String three; one=JOptionPane.showInputDialog("Enter First Number"); two=JOptionPane.showInputDialog("Enter Second Number"); three=JOptionPane.showInputDialog("Enter third Number"); x = Integer.parseInt(one); y = Integer.parseInt(two); z = Integer.parseInt(one); } public static int max(int x, int y, int z); { } }
I am supposed to:
"Use a separate method for each of the following activities:
1) calculates the sum of four integers
2) select maximum number among four integers
You MUST use methods other than main( ) method."
and it is based off a program that asks you to input 4 integers, and it then calculates the sum of these 4 integers, and it selects the maximum among these four numbers. Finally, the program prints the results (the sum and the maximum) in a dialog box, each on a different line.
thanks again


Reply With Quote


Bookmarks