User Profile
Collapse
-
Also, I needed to have the salesDifference scope wide because that is how we are being taught right now and so I think it would be best to write the code based on how we were taught for now. -
That made a lot more sence, because I thought that when calling the method you needed to put the variable that you returned, in the brackets of the method, when you just need to reinput the input parameters because the value you returned was set to the method. This fixed my problem.
My method was supposed to look like:
Sales is an array and so...Code:averageSales = comp.GetAverageSales(sales);
Leave a comment:
-
-
Why doesn't my method return the variable at all?
I am currently working on a Windows Forms Application and I need to create a few methods in another class and then call the methods back into my form1.cs but every time I set my global variables equal to the ones I returned from the method, it says that my variables do not exist in the current context.
I'm still learning how to work with c sharp so it might not be any close to perfect but this is an example of what is happenning:...
No activity results to display
Show More
Leave a comment: