• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Teach Yourself : Gain Performance in 1 minutes

 
Ranch Hand
Posts: 400
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Want to gain your performance ?
Maybe... We have all been to those meetings where someone wants "more than 100%.", well here's how we do that ...
First of all, here's a little math that might prove helpful in the future.
IF :
A = 1
B = 2
C = 3
D = 4
E = 5
F = 6
G = 7
H = 8
I = 9
J = 10
K = 11
L = 12
M = 13
N = 14
O = 15
P = 16
Q = 17
R = 18
S = 19
T = 20
U = 21
V = 22
W = 23
X = 24
Y = 25
Z = 26
Then:
H A R D W O R K = 8+1+18+4+23+15+18+11 = Only 98%
K N O W L E D G E = 11+14+15+23+12+5+4+7+5 = Only 96%
A T T I T U D E = 1+20+20+9+20+21+4+5 = 100%..... This is how we achieve 100% in LIFE.
important to note is :
B U L L S H I T = 2+21+12+12+19+8+9+20 = 103%
So now we know what all those high-priced consultants, top management, and motivational speakers really mean when they want to exceed 100%!
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Stevie, you have short memory span?
This has been posted some time ago but maybe someone still might find it entertaining.
 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
heavy = 61 light = 56 weight = 72 attitude = 100 knowledge = 96 intelligence = 115 view = 59 outlook = 109 problem = 81 solution = 125 positive = 115 negative = 83 past = 56 present = 97 future = 91 JuliaRoberts = 150 RobertDeniro = 143 TomCruise = 123 OsamaBinLaden = 110 UnitedStatesOfAmerica = 228 India = 37 UnitedKingdom = 146 Germany = 83 France = 47 NewYorkCity = 168 SunMicroSystem = 213 Microsoft = 118 BillGates = 87 JAVA = 34 Sex = 48 Air = 28 Land = 31 Water = 67 Expert = 88 Idiot = 57 Radio = 47 Television = 130 doctor = 75 Engineer = 77 programmer = 124
----
do it yourself: pass words as command line arguments.

public class AlphaNum
{
public static void main (String args[])
{
for(int l =0; l < args.length; l++)
{
String []alpha={"A", "B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
int sum = 0;
String word = args[l];

for(int i = 0; i < word.length(); i++)
{
String ch = word.substring(i,i+1);
for (int k = 0; k < alpha.length; k++)
{
if(ch.equalsIgnoreCase(alpha[k]))
{
sum += k+1;
break;
}
}
}

System.out.println(args[l] + " = " + sum);
}

}

}
 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A programmer's instinct

<code>
public class AlphaNum {
public static void main (String args[]) {
if (args.length != 1) {
System.out.println("Syntax: java AlphaNum <word_to_process>");
return;
}
String m_Alphabets="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int m_Sum = 0;
int aVal = -1;
for(int i = 0; i<args[0].length(); i++) {<br /> aVal = m_Alphabets.indexOf( (""+args[0].charAt(i)).toUpperCase().charAt(0) ) + 1;<br /> if(aVal>-1) m_Sum+= aVal;
}
System.out.println(args[0] + " = " + m_Sum);
return;
}
}
</code>

Any advice?

Ashok.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by J Ash:
A programmer's instinct


You have a bad instinct dude. I can't even compile your program
by the way, "procrastinate" = 159 !!!
 
Ashok Mash
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, its time to go and
My apologies!! That was because I used HTML code../code tags. I should have used UBB CODE.. /CODE. And also I should have left a space between < and args[0].... in the code. Either UBB engine or my poor browser was misunderstanding it as a tag, I guess.

Thanks for pointing out the mistake, Mr. Numero Uno!
reply
    Bookmark Topic Watch Topic
  • New Topic