thara Posted August 2, 2013 Share Posted August 2, 2013 (edited) At a PHP exam I sat recently I got 2 questions about variables and here I have posted it. In this questions I couldn't understand at all and couldn't select write one. Can any body here, explain how this logic work. This wat my question - If Variable 1,2 and 3 have the values 3,5 and 7 respectively, select the correct sequence of equations that will result in placing values 12 in variable 1 and 15 in variable 3.(Use only ADD operator)1) 1 + 2 = 32) 2 + 3 = 13) 3 + 2 = 34) 2 + 1 = 25) 2 + 2 = 36) 2 + 3 = 3 If variables 1,2 and 3 have the values 10, 15 and 20 respectively, select the correct sequence of equations that will result in placing 55 in variable 2 and 60 in variable 3.(Use only ADD operator)1) 3 + 3 = 12) 2 + 1 = 33) 1 + 2 = 24) 3 + 3 = 25) 1 + 3 = 36) 2 + 2 = 2 Any explanation are greatly appreciated. Thank you. Edited August 2, 2013 by thara Quote Link to comment https://forums.phpfreaks.com/topic/280745-how-this-logic-work-need-some-explanation/ Share on other sites More sharing options...
ignace Posted August 2, 2013 Share Posted August 2, 2013 1=3, 2=5, 3=7 1) 1 + 2 = 3 <=> 3 + 5 = 8 2) 2 + 3 = 1 <=> 5 + 7 = 12 => 1st op. (1) 1=12 3) 3 + 2 = 3 <=> 7 + 5 = 12 => 2nd op. (2) 3=15 4) 2 + 1 = 2 <=> 5 + 3 = 8 5) 2 + 2 = 3 <=> 5 + 5 = 10 => 2nd op. (1) 3=10 6) 2 + 3 = 3 <=> 5 + 7 = 12 Quote Link to comment https://forums.phpfreaks.com/topic/280745-how-this-logic-work-need-some-explanation/#findComment-1443094 Share on other sites More sharing options...
thara Posted August 2, 2013 Author Share Posted August 2, 2013 @ignace thanks for reply. Still I am confuse about this. Can you kindly elaborate it? Sorry for my misunderstand. Quote Link to comment https://forums.phpfreaks.com/topic/280745-how-this-logic-work-need-some-explanation/#findComment-1443143 Share on other sites More sharing options...
ignace Posted August 2, 2013 Share Posted August 2, 2013 (edited) 1 + 2 = 3 each number in this equation is a variable. Find the equation that alters the value of the variable to the requested value. 1 + 2 = 3 thus is 3 + 5 and it would assign 8 to variable 3. The text is confusing because they use numbers as variable names, but if you read it literally, it makes sense. The first question asks to find the equation that makes variable 1 contain value 12 which is done by equation 2 (2 + 3 = 1 <=> 5 + 7 = 12). The second question to get 15 in variable 3 is done by combining (sequence) equations 5 and 3. Edited August 2, 2013 by ignace Quote Link to comment https://forums.phpfreaks.com/topic/280745-how-this-logic-work-need-some-explanation/#findComment-1443146 Share on other sites More sharing options...
thara Posted August 2, 2013 Author Share Posted August 2, 2013 Thanks for good explanation. Still it not makes 100% sense for me to select the answer to my question. This was my complete question with given answers to select correct one. 1. If Variable 1,2 and 3 have the values 3,5 and 7 respectively, select the correct sequence of equations that will result in placing values 12 in variable 1 and 15 in variable 3. (Use only ADD operator) 1) 1 + 2 = 3 2) 2 + 3 = 1 3) 3 + 2 = 3 4) 2 + 1 = 2 5) 2 + 2 = 3 6) 2 + 3 = 3 A. 2,4,1 B. 4,3,6 C. 2,5,6 D. 3,4,5 E. 2,3,4 Quote Link to comment https://forums.phpfreaks.com/topic/280745-how-this-logic-work-need-some-explanation/#findComment-1443225 Share on other sites More sharing options...
hakimserwa Posted August 16, 2013 Share Posted August 16, 2013 Hello i think it will be simply understandable if you put it this way. Question 1) If Variable 1,2 and 3 have the values 3,5 and 7 like the last user said, the problem in this question is they used numbers for valuable representation. literary a valuable is a place holder for a value. so what they are saying here is if we had place holders 1,2 and 3. place holder 1holds value 3, place holder 2 holds value 5 and place holder 3 holds value 7. this is how its writen in php. first of all in php valuable names have rules, one of which is theie names cant start with an integer. so we shall represent the above valuables in this way. $one = 3; $two = 5; $three =7; I think by now the question starts to be clear. Quote Link to comment https://forums.phpfreaks.com/topic/280745-how-this-logic-work-need-some-explanation/#findComment-1445416 Share on other sites More sharing options...
thara Posted August 25, 2013 Author Share Posted August 25, 2013 In my first question, still I am confusing how I get 15 for variable 3 is doing by combining equations 5 and 3. Any explanation is very welcome. Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/280745-how-this-logic-work-need-some-explanation/#findComment-1446648 Share on other sites More sharing options...
kicken Posted August 25, 2013 Share Posted August 25, 2013 In my first question, still I am confusing how I get 15 for variable 3 is doing by combining equations 5 and 3. $one = 3; $two = 5; $three = 7; //equation 5 $three = $two + $two; //5 + 5 = 10, store 10 in $three //equation 3 $three = $three + $two; //10 + 5 = 15, store 15 in $three Quote Link to comment https://forums.phpfreaks.com/topic/280745-how-this-logic-work-need-some-explanation/#findComment-1446689 Share on other sites More sharing options...
thara Posted August 26, 2013 Author Share Posted August 26, 2013 Thanks for reply. Then my question is, is there any correct answer to my 1st question? I think equations should be 1, 3, and 5 for this.. right? 1. If Variable 1,2 and 3 have the values 3,5 and 7 respectively, select the correct sequence of equations that will result in placing values 12 in variable 1 and 15 in variable 3.(Use only ADD operator)1) 1 + 2 = 32) 2 + 3 = 13) 3 + 2 = 34) 2 + 1 = 25) 2 + 2 = 36) 2 + 3 = 3 A. 2,4,1B. 4,3,6C. 2,5,6D. 3,4,5E. 2,3,4 Quote Link to comment https://forums.phpfreaks.com/topic/280745-how-this-logic-work-need-some-explanation/#findComment-1446871 Share on other sites More sharing options...
enil14someone Posted January 1, 2014 Share Posted January 1, 2014 Thanks for reply. Then my question is, is there any correct answer to my 1st question? I think equations should be 1, 3, and 5 for this.. right? (correct me if i'm wrong so...) try checking it? 1. If Variable 1,2 and 3 have the values 3,5 and 7 respectively, select the correct sequence of equations that will result in placing values 12 in variable 1 and 15 in variable 3. (Use only ADD operator) 1) 1 + 2 = 3 2) 2 + 3 = 1 3) 3 + 2 = 3 4) 2 + 1 = 2 5) 2 + 2 = 3 6) 2 + 3 = 3 variables: one = 3, two = 5, three = 7 goal: one = 12 and three = 15 your answer: 1,3,5 check: 1 : one + two = three => 3 + 5 = 8 /// three = 8 so: one = 3, two = 5, three = 8 3: three + two = three => 8 + 5 = 12 ///three = 12 so: one = 3, two = 5, three = 12 5: two + two = three => 5 + 5 = 10 ///three = 10 so: one = 3, two = 5, three = 10 /// conditions have not been met. one should be equal to 12 ( one = 12) and three should be equal to 15 (three = 15) also your answer should be in the choices (i.e the a, b, c choices ) try using these method and see if you can find the answer (i've tried it) Quote Link to comment https://forums.phpfreaks.com/topic/280745-how-this-logic-work-need-some-explanation/#findComment-1463534 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.