mardi 23 janvier 2018

save on variable a method [on hold]

i have a method on my exam.It was like this lets say because i can't remember it at all i will split the part with how i did because i am not sure if my theory is right.In java,is like this way but in c i am not sure.The issue is in a methoda i call another methodb this happen,but the way i did x save a number from the methodb i am not sure if is this right.Also,i write return because i want to return it.Did i do right?thanks

methoda()
{
double x;
  if(){
  x=methodb(); // i had a method b 
}else if(){
x=method()-1;
}
return x;
}// end of the method

Aucun commentaire:

Enregistrer un commentaire