Sample program to calculate cans of paint needed for a square room

int h = readInt("Enter height: ");
int w = readInt("Enter width: ");
int area = h * w;
int totalArea = area * 4;
int paintCans = totalArea/65 +1;
System.out.println("you need " +
  paintCans + " paint cans");
-----------------------------------

 

Sample program to find the biggest number if both numbers are < 0 or the smallest number if both numbers are >0

int x = ("Enter number 1:");
int y = ("Enter number 2:");
int biggest = x;
int smallest = y;
if (y > x){ biggest = y;           
           smallest = x;}
if (x>0 && y>0) System.out.print(smallest);
else
if (x<0 && y<0) System.out.print(biggest);
else
System.out.print("out of range");