Java Past Paper - Is it just me or wording of this switch statement q is making it unsolvable? -


i have been revising exam , have found question in 1 of past papers (at least me) seem unsolvable. have attach picture because has been scanned , saved set of images.

you can't tell output of code when taking consideration values sub questions because no actual parameter being passed method , switch statement. understanding correct, or missing something?

i agree - without knowing value of num is, can't decide output is. maybe there typo , method supposed be:

public static void compute(int value) {     switch(value) {...} } 

in case answer should take account fact if change value in 1 of case statements, original value used decide if other case statements should executed (in other words, 1 case statement can executed).


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -