I have just started a part time course and I have limited class time. I am really stuck on this question, any help solving it is greatly appreciated!
here's the question....
(a) write a subprogram which will take one argument, x, and return x*3 + 1. I.e. a Java method would be
int fun(int x){
return x*3 + 1;
}
(b) Write a fragment of code which will set variable a0 to 5 and then call fun on a0 and put the result in a1.
a1 = fun(a0);