aspose file tools*
The moose likes Programming Diversions and the fly likes 5th grade math Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "5th grade math" Watch "5th grade math" New topic
Author

5th grade math

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
if a=1 and z=26 what does:
Methionylglutaminylarginyltyrosylglutamylserylleucylphen-
ylalanylalanylglutaminylleucyllysylglutamylarginyllysylgluta-
mylglysylalanylphenylalanylvalylprolylphenylalanylyalylthre-
onylleucylglcycylaspartylprolylglicylisoleucyglutamylgluta-
minlserylleucyllysylisoleucylaspartylthreonylleucylisoleu-
cylglutamylalanylglyclyalanylaspartylalanylleucyglutamylle-
ucylgluycylisoleucylproluylphenylalanyserylaspartyprolylleu-
celalanylaspartylglycylprolylthreonylisolleucyglutaminylaspa-
raginylalanythreonylleucylarginylalanylphenylalanylalanylal-
anylglycylvalylthreonylprolylalanylglutaminylcysteinylphen-
ylalanylglglutamylmethionylleucyalanylleucylisoleucylarginyl-
glutaminyllysylhistidylprolyuthreonylisoleucylprolylisoleuc-
ylglycylleucylleucylmethionyltyrosylalanylasbaraginylleucyl-
valylphenylalanylsparaginyyllysylglycylisoleucylaspartylglut-
amylphenylalanylyltyrosylalanylglutaminylcysteinylglutamyll-
ysylvalylglycylvalylspartylserylvalylleucylvallalanylaspart-
ylvalylprolylvalvlglutaminylglutamylserylalanylprolylpheny-
lalalrginylglutaminylalanylalanylleucylarginylhistidylasp-
araginylvalylalalprolylisoleucylphenylalanylisoleucylcystei-
nylprolyprolylaspartylalanylaspartylaspartyspartyleucylle-
ucylarginylglutaminylisoleucylalanylseryltyroslglycylargin-
ylglycyltyrosylthreonyltyrosylleucylleucylserylarginlalanyl-
glycylvalylthreonylglycylalanylglutamylasparaginylarginyla-
nylalanylleucylprolylleucylaspaaginylhistidylleucylvalylalan-
yllysylleucyllysylglutamyltyrosylasparagimylalanylalanypro-
lylprolylleucylglutaminylglycylphenlalanylglycylisoleyucyls-
erylalanylprolylaspartylglutaminylvalyllysylalanylalanylisol-
eucylalspartylalanylglycylalanylalanylglycylalanylasoleucylse-
rylglycylserylalanylisoleucylbalyllysylisoleucylisoleucylgluta-
mylglutaminylhistidylasparaginylisoleucylglutamylpronylglu-0
tamyllysylmethionylluecylalanylalanyoeucyllysylvalylpheny-
lalanylvalylglutamilylprolylmethionyllysylalanylalanylthreo-
nylarginylserine. = if added up???
stara szkapa
Ranch Hand

Joined: Mar 27, 2003
Posts: 321
I'm sure Rain Man would know.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
25680
[ September 11, 2003: Message edited by: Thomas Paul ]

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1824

Strange... I got 25693


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
When I ran it the first time I didn't notice that they had a capital letter in their sample. Of course, the "spec" only refers to lower case characters in the sample ("a=1, z=26") so the actual answer isn't quite clear.
Here's my version which is vastly superior to yours:

[ September 11, 2003: Message edited by: Thomas Paul ]
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Originally posted by Thomas Paul:

Here's my version which is vastly superior to yours:
[ September 11, 2003: Message edited by: Thomas Paul ]

Well, good for you
1. You code is good But not Reusable.
2. you did not realize the mistake (you can argue that Caps are not defined in spec - Which you probably are doing the same at your work hehe) untill the other guy did it correct.
Overall you need an improvement in your OO Basics
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1824

True about the capital letter, but since capitals are valued 32 lss than their lowercase counterparts, I would have expected you to get 25661 (which is what I get when I remove the lower-case enforcement). I'm still wondering about your original answer, but I'm not going to lose any sleep over it.
BTW, did you know that you misspelled "inferior?"
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1824

Hey! you changed your first answer from 25679 to 25680! I still don't see how you got that; running your code on my machine results in 25693 -- the answer I got.
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I am getting 25645.
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Moving to Programming Diversions. Yeah, definitely moving to Programming Diversions. Eight minutes to Wapner. Eight minutes to Wapner.
[ September 11, 2003: Message edited by: Jason Menard ]
[ September 27, 2003: Message edited by: Marilyn de Queiroz ]
A. Levi
Ranch Hand

Joined: Jul 26, 2003
Posts: 97
Joe your Answer: 25693 is correct. my 5 cents.

[ September 11, 2003: Message edited by: Levi Allam ]
Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1874
Yes, its 25693.I copied that string hurriedly.


MH
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
1. You code is good But not Reusable.
I was aked to give a number not code.
2. you did not realize the mistake (you can argue that Caps are not defined in spec - Which you probably are doing the same at your work hehe) untill the other guy did it correct.
Actually I realized my mistake immediately but the server crashed and was down for 7 hours before I could correct it.
But there is still a debate. How should we treat a capital "M"? Should it be treated that same as a lower case "m". If you think so, why?
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
There is an interesting defect with the "convert the char to int" method. What if we randomize the values of the letters? a=6, b=11, c=2, d=18, etc.
My method works easily by changing the order of the letters in the value array. So there.
[ September 11, 2003: Message edited by: Thomas Paul ]
Bhau Mhatre
Ranch Hand

Joined: Jun 11, 2003
Posts: 199
Originally posted by <azra>:
if a=1 and z=26 what does:
Methionylglutaminylarginyltyrosylglutamylserylleucylphen-
ylalanylalanylglutaminylleucyllysylglutamylarginyllysylgluta-
mylglysylalanylphenylalanylvalylprolylphenylalanylyalylthre-
onylleucylglcycylaspartylprolylglicylisoleucyglutamylgluta-
minlserylleucyllysylisoleucylaspartylthreonylleucylisoleu-
cylglutamylalanylglyclyalanylaspartylalanylleucyglutamylle-
ucylgluycylisoleucylproluylphenylalanyserylaspartyprolylleu-
celalanylaspartylglycylprolylthreonylisolleucyglutaminylaspa-
raginylalanythreonylleucylarginylalanylphenylalanylalanylal-
anylglycylvalylthreonylprolylalanylglutaminylcysteinylphen-
ylalanylglglutamylmethionylleucyalanylleucylisoleucylarginyl-
glutaminyllysylhistidylprolyuthreonylisoleucylprolylisoleuc-
ylglycylleucylleucylmethionyltyrosylalanylasbaraginylleucyl-
valylphenylalanylsparaginyyllysylglycylisoleucylaspartylglut-
amylphenylalanylyltyrosylalanylglutaminylcysteinylglutamyll-
ysylvalylglycylvalylspartylserylvalylleucylvallalanylaspart-
ylvalylprolylvalvlglutaminylglutamylserylalanylprolylpheny-
lalalrginylglutaminylalanylalanylleucylarginylhistidylasp-
araginylvalylalalprolylisoleucylphenylalanylisoleucylcystei-
nylprolyprolylaspartylalanylaspartylaspartyspartyleucylle-
ucylarginylglutaminylisoleucylalanylseryltyroslglycylargin-
ylglycyltyrosylthreonyltyrosylleucylleucylserylarginlalanyl-
glycylvalylthreonylglycylalanylglutamylasparaginylarginyla-
nylalanylleucylprolylleucylaspaaginylhistidylleucylvalylalan-
yllysylleucyllysylglutamyltyrosylasparagimylalanylalanypro-
lylprolylleucylglutaminylglycylphenlalanylglycylisoleyucyls-
erylalanylprolylaspartylglutaminylvalyllysylalanylalanylisol-
eucylalspartylalanylglycylalanylalanylglycylalanylasoleucylse-
rylglycylserylalanylisoleucylbalyllysylisoleucylisoleucylgluta-
mylglutaminylhistidylasparaginylisoleucylglutamylpronylglu-0
tamyllysylmethionylluecylalanylalanyoeucyllysylvalylpheny-
lalanylvalylglutamilylprolylmethionyllysylalanylalanylthreo-
nylarginylserine. = if added up???

First of all, is this a 5th grade Math?
Second, you said a=1 and z=26, but did not specify whether az=126 or az=27
Third, it looks like a organic chemistry stuff more then 5th grader math-
Methionyl glutaminyl arginyl tyrosyl glutamyl seryl leucyl phenyl ...
Fourth, you all java coders got it all wrong. I see a minus sign between the lines
Methionylglutaminylarginyltyrosylglutamylserylleucylphen-
ylalanylalanylglutaminylleucyllysylglutamylarginyllysylgluta-
...
not a plus sign. So why do yo'll add it up?
aaa-
bbb
should be 111-222 == -111 or
atleast 3-6=-3 but not 9.


-Mumbai cha Bhau
Leslie Chaim
Ranch Hand

Joined: May 22, 2002
Posts: 336
TIMTOWTDI


Normal is in the eye of the beholder
Leslie Chaim
Ranch Hand

Joined: May 22, 2002
Posts: 336
Or per line:

Of course if you only care about the answer you wrap the print statement in an END { BLOCK }

And I will take advantage of Thomas's arguments -- It does give the answer!
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
[LC]: TIMTOWTDI
Welcome back, Leslie.
[ September 25, 2003: Message edited by: Jim Yingst ]

"I'm not back." - Bill Harding, Twister
Leslie Chaim
Ranch Hand

Joined: May 22, 2002
Posts: 336
Originally posted by Jim Yingst:
[LC]: TIMTOWTDI
Welcome back, Leslie.

Thanks JRY,
Yes, it has been a while as you will see here.
Too busy at work and once I do make it to the barn I just have so much catch-up to do.
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Yes, it has been a while as you will see here.
Oh, I meant even longer than that. "TIMTOWTDI" seems to signal the return of the perlmonger we know and love. Tell, me, how did you regain control from the imposter?
Leslie Chaim
Ranch Hand

Joined: May 22, 2002
Posts: 336
Jim, I don't know anything about any imposters.
Am I missing something here?
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Just a bad joke. Responding to some of your previous posts in which you did not mention an alternate Perl solution, I had commented a couple times that obviously this was not the real Leslie Chaim, but some imposter. Now I see you're back. No criticism intended, just minor teasing...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 5th grade math