just having some problems with this program, the program should compute the sum of the three numbers,
and i have to display the average of those three.,im done and im fine with it..
the problem is..
to display which of the three is the highest number, which of the three is the lowest one and to show how many odd , and how many even number that have been keyed in.
can anyone help with this simple algorithm?
this is the syntax
// I dont have any more idea on what kind of algorith should i make to display that problemimport java.io.*; public class threeNumbers { private static BufferedReader br= new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args)throws IOException { String number1,number2,number3; int num1,num2,num3,result,average; System.out.print("Enter a number : "); number1=br.readLine(); num1=Integer.parseInt(number1); System.out.print("Enter the second number : "); number2=br.readLine(); num2=Integer.parseInt(number2); System.out.print("Enter the third number : "); number3=br.readLine(); num3=Ingteger.parseInt(number3); result=num1+num2+num3; average=result/3; System.out.println("The result for the three numbers is : " +result); System.out.println("The average for the three numbers is : " +average); } }
display how many three numbers