jeudi 16 avril 2015

Static method issues


Vote count:

-4




I've been going at my code for a while and I was asked to do the following:


"static method called ModifyPhonePrices(). The details of this method are as follows:




  • The method accepts 3 parameters: a 2-dimentional array of cell phones, and two double values. The method also returns an integer.




  • The method will search the entire array looking for any cell phone with a price that matches the 2nd parameter, and if found, the method will replace the price of that cell phone with the value passed as the 3rd parameter."




How is it possible for me to create a method that will both look for object ( the Cellphone object that is) and double values. Wouldn't I need two different arrays for that to happen?



public static double modifyCellPhone ( double x, double y)


That, I understand. What baffles me is including the 2-d array in there.



asked 2 mins ago

JSm

1






Static method issues

Aucun commentaire:

Enregistrer un commentaire