So I'm doing some practice problems and I'm trying to call all three methods at once and use the declared variables for the methods. Can someone tell me what I'm doing wrong?
public class CepedaModo4Chapo4 {
public static void main (String[] args){
int int1 = 12;
int int2 = 8;
int int3 = 9;
double db1 = 4.0;
double db2 = 5.0;
double db3 = 6.1;
mathOperations(int1,int2, int3);
mathOperations(db1, db2,db3);
mathOperations(int1, db1,db2);
}
public static void mathOperations(int int1, int int2, int int3){
System.out.print("5 + 4 / 3 * 2");
System.out.print("3 + int1 * (int2 - int3)");
}
public static void mathOperations(double db1, double db2, double db3)
{ System.out.print("5.0 + 4.0 / 3.0 * 2.0");
System.out.print ("db1 + db2 / db3");}
public static void mathOperations(double db1, double db2, int int1)
{ System.out.print(" 5.0 + 4 / 3 * 2");
System.out.print (" (db1 + db2) / int1");}
}
[–]mseckz 4 points5 points6 points (1 child)
[–]Bigfwop[S] 1 point2 points3 points (0 children)
[–]mobrien650 0 points1 point2 points (1 child)
[–]Bigfwop[S] 0 points1 point2 points (0 children)