The Student Room Group

Help mee someoneee

Anyone who is good at maths .. please could u help meeeeeee

this theorem, is it true or false??? and could u help me proof it

Let x and m be integer variables. The variable m always holds a positive number after executing the following Java code:
if (x>10) {m = x-7;} else {m = 5;}
True, any value above 10 - 7 is positive. When 10 or below the number is 5 so it's also positive.
(edited 10 years ago)
how if i were to use a proof by case, how would i write it??
Reply 3
Original post by PeaceTreaty
False, if x is less than 10, m will be 5 so m isn't always positive.


How is 5 not positive ?

To me it looks like, the range of m is from 4 to infinity.
(edited 10 years ago)
Original post by zaback21
How is 5 not positive ?

To me it looks like, the range of m is from 4 to infinity.


Ugh my heads not in the right place today :| edited my answer. For some reason I got positive and negative mixed up with odd and even (don't ask).
(edited 10 years ago)
so how would i write it using the proof by case
Reply 6
Original post by bart simpson993
so how would i write it using the proof by case


I don't know about proof by case, but I already mentioned the range of m={4,infinity}

Quick Reply

Latest

Trending

Trending