# minimum,/maximium

• 09-30-2009, 04:48 PM
sinista
minimum,/maximium
a class(calculate) containing three numbers, use set method to set values(overloading) to instance variables.
Find the minimum value of all three values
Find the maximum value of any two values

Method to :
Display the three numbers and their maximum value.
Display the two numbers and the minimum value.
• 09-30-2009, 05:40 PM
Tolls
And?
(10 chars)
• 09-30-2009, 05:49 PM
sinista
• 09-30-2009, 05:56 PM
Tolls
All you've done is post your homework.
How about giving us what you've managed so far, and asking for help with a particular bit of it? Otherwise we might get the idea that you just want us to do your homewrok for you.
• 10-01-2009, 03:17 PM
sinista
minimum/maximum
*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package calcultejava;

/**
*
* @author sinista
*/
public class calculte {
int num1,num2,num3,minimum,maximum;
}
public calculte(){
}
public void setValues(int n1,int n2,int n3, int min, int max)
{
num1 = n1;
num2 = n2;
num3 = n3;
minimum = min;
maximum = max;
}
public int getnum1(){
return num1;
}
public int getnum2(){
return num2;
}
public int getnum3(){
return num3;
}
public int getminimum(){
return minimum;
}
public int getmaximum(){
return maximum;
}
public void display(){
System.out.printLn("The minimum of"+ num1+ ","+ num2+"and"+ num3+"is"+Math.min(num1,num2,num3));
System.out.printLn("The maximum of"+ num1+ ","+ num2+"and"+ num3+"is"+Math.max(num1,num2,num3));

}
}

THE MAIN CLASS IS BELOW:cool:
_______________________

public class CalculteMain{
public static void main(String args[])
{
for (num1); = (min); (num1<=max);(num1++);
System.out.printLn("The minimum of)

Calculte num1 = new Number(5);
num1.display()
Calculte num2 = new Number(8);
num2.display()
Calculte num3 = new Number(9);
num3.display()
}
• 10-01-2009, 03:21 PM
Tolls
And?
(I seem to be saying that a lot).

Which bit doesn't work?
Which bit are you having problems with?
And you ought to use CODE tags, since it's largely unreadable.
• 10-01-2009, 04:54 PM
sinista
i am using netbeans 6.7.1.
netbeans syntax is saying i need to have a main class but i do, minimum,maximum value not working out.
• 10-01-2009, 05:07 PM
Tolls