Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,155,269 members, 7,826,034 topics. Date: Monday, 13 May 2024 at 08:50 AM |
Nairaland Forum / Science/Technology / Programming / Question For Logical Thinkers (742 Views)
Logical Math Question / How To Resolve Logical Corruption From Exchange Server? / Programming Required Logical Mind. (2) (3) (4)
Question For Logical Thinkers by Cybergenius(m): 1:47am On Jul 10, 2014 |
Tom asked his Granny how old she was Rather than giving him a straight answer,she replied, "i have 6 children, and there are 4 years between each one and the next, i had my first child (Your uncle peter) When i was 19. Now the youngest one (Your aunty jane) is 19 herself, Thats all i'm telling you.How old is tom's Granny? |
Re: Question For Logical Thinkers by aaidel(m): 2:56am On Jul 10, 2014 |
58 |
Re: Question For Logical Thinkers by kibo: 4:28am On Jul 10, 2014 |
Spot On !!! aaidel: 58 @OP, BTW when you say 4 years in between each one, it might not necessarily mean 4 years older, for brevity sake. |
Re: Question For Logical Thinkers by zicjoe(m): 7:21am On Jul 10, 2014 |
The ansa is 63 |
Re: Question For Logical Thinkers by CodeHouse: 8:03am On Jul 10, 2014 |
Last Child - 19 5th Child - 23 4th Child - 27 3rd Child - 31 2nd Child - 35 1st Child - 39 Granny = 19 + 39 = 58 |
Re: Question For Logical Thinkers by Nobody: 10:14am On Jul 10, 2014 |
zz |
Re: Question For Logical Thinkers by asalimpo(m): 1:14pm On Jul 10, 2014 |
// fields numOfch = 6 //number of children ageDiff = 4 gAgeFc = 19 //grannie age at first child ageYcNw = 19 // now age of youngest child. grannyAgeNow=??//yet 2 b determined //Functions: /*cumulative age difference*/ cumAgeDiff(AgeDifference,numOfChildren) { return ageDifference*numOfChildren-1 } /*grannies age after nth child */ gAgeAtNthCh(nthChild,grannyAgeFirstChild) { return grannyAgeFirstChild+cumAgeDiff(ageDiff,nthChild) } /* grannies age now */ gAgeNow(grannyAgeNthChild, nowAgeNthChild) { if(nowAgeNthChild<0) return -1 return grannyAgeNthChild+nowAgeNthChild } //grannys age at 6th child grannyAgeNow = gAgeNow(gAgeNthCh(6,19), 19) //or grannyAgeNow = gAgeNow(gAgeNthCh(numOfCh,gAgeFc), ageYcNw). //gAgeNow=58 |
(1) (Reply)
Basic Colour Theory For Programmers / To Lean Programming Language What Do I Need To Know First / Urgent Advice Needed
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 8 |