Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Java 

Gay-O-Meter, did I make any mistakes?

So I decided to make a "Gay-O-Meter" because me and my brother always
joke around and call each other gay. I would like to know (this is my second
program), if I made any mistakes or should have done something differently.

It works at least haha.
// Note, this is for practice not usage.

Pastebin: http://pastebin.com/jtHMV7JP

Code
/*
* Gay-O-Meter
* Reece Leu
* 2014-10-04
*/
package gay.o.meter;
import java.util.Scanner;

public class GayOMeter {
    public static void main(String[] args) {
      Scanner getName = new Scanner(System.in);

      // Display welcome message.
      //Ask for users name.
      System.out.println("Welcome to Gay-O-Meter V2!");
      System.out.println("Please enter your name.");
      String userName = getName.nextLine();

      // Display a message.
      // Counts amount of letters in username.
      System.out.println("Calculating gayness...");
      int letterCount = userName.length();

      //Checks if userName equals Reece.
      // Checks is userName equals Logan.
      // Checks if letterCount is less than 1 or more than 10.
      // Finds % of how gay userName is depending on letterCount.
      if (userName.equals("Reece")) {
      System.out.println(userName + " is not gay.");
      } else if (userName.equals("Logan")) {
      System.out.println(userName + " is 400% gay.");
      } else if (letterCount > 10 || letterCount < 2) {
      System.out.println("ALLAH AKUBAR");
      } else {
      String howGay = null;
      switch (letterCount) {
            case 2: howGay = "10%";
            break;
            case 3: howGay = "20%";
            break;
            case 4: howGay = "30%";
            break;
            case 5: howGay = "40%";
            break;
            case 6: howGay = "50%";
            break;
            case 7: howGay = "60%";
            break;
            case 8: howGay = "70%";
            break;
            case 9: howGay = "80%";
            break;
            case 10: howGay = "80%";
            break;
            }
      System.out.println(userName + " is " + howGay + " gay.");
      }    
    }
}
Oh.. well ok then XD this seems pretty cool I guess :P XD
Only problem I see is if they put in a name over 10 characters or under 2 characters it returns null, so you should make a default case.

EDIT:

[Image: SKhvDZH.png]
:(
You should use the levenshtein distance algorithm to determine how close the name is to your name.
[Image: QiUbeYa.png]
(Oct 4, 2014 11:23 PM)Kappa Wrote:  Only problem I see is if they put in a name over 10 characters or under 2 characters it returns null, so you should make a default case.

EDIT:

[Image: SKhvDZH.png]
:(

Haha yeah, I was going to make it so that if your name is over 10 character
you are allah akubar or something dumb. I just became tired.
Only issue I see is more of a program flow "problem", you check if it's your name and then.say not gay if it's not your name then you start counting the letters.then you check if it's the other persons named then you decide how gay they are if they aren't Logan or whatever the name is.

So right now it's:
if
else
if
else

Rather than:
if
elseIf
else

I won't tell you the way to make it like that cause horny you can figure it out grim what I've said, if not just say so and I'll let ya know.:P
(Oct 5, 2014 12:47 AM)▁▂▃▄▅▆M1kep▆▅▄▃▂▁ Wrote:  Only issue I see is more of a program flow "problem", you check if it's your name and then.say not gay if it's not your name then you start counting the letters.then you check if it's the other persons named then you decide how gay they are if they aren't Logan or whatever the name is.

So right now it's:
if
else
if
else

Rather than:
if
elseIf
else

I won't tell you the way to make it like that cause horny you can figure it out grim what I've said, if not just say so and I'll let ya know.:P

Ah yeah I see what you mean, I moved the countLetters above my name.
Ill update the script tomorrow. 2am haha.

Wow just looked up else if.
Thanks, I didnt know that was a thing.
HAHAHAHAAHAHAHAHA MAKING FUN OF THE SEXUALITY OF OTHERS IS SOOOO FUNNY!!! HAHAHAHAHAHAH!!!111111eleven!

oh dear... -.-
Because we are hacker - and hacker have black terminals with green font color!
(Oct 5, 2014 04:49 AM)T0SH1VA Wrote:  HAHAHAHAAHAHAHAHA MAKING FUN OF THE SEXUALITY OF OTHERS IS SOOOO FUNNY!!! HAHAHAHAHAHAH!!!111111eleven!

oh dear... -.-

"So I decided to make a "Gay-O-Meter" because me and my brother always
joke around and call each other gay."

Keyword: joke

OP, I know secret gay guys that call straight guys gay because they secretly like them.
o.O
(Oct 5, 2014 06:50 AM)ObscureCoder Wrote:  OP, I know secret gay guys that call straight guys gay because they secretly like them.
o.O

You're so gay. wink wink nudge nudge
Lol very funny , why dont u start a website like xxx.homo.com ?
(Oct 5, 2014 02:02 AM)R҉eece҉ Wrote:  Ah yeah I see what you mean, I moved the countLetters above my name.
Ill update the script tomorrow. 2am haha.

Wow just looked up else if.
Thanks, I didnt know that was a thing.

Haha no worries :) we all learn someway
Oh wow, another 12 year old adolescent on this forum still using derogatory terms to sugarcoat homosexuals.

Not impressed.
(Oct 5, 2014 09:52 AM)Sparta. Wrote:  Oh wow, another 12 year old adolescent on this forum still using derogatory terms to sugarcoat homosexuals.

Not impressed.

Wow look another user getting butt hurt over some words, it's a joke between two brothers and he posted it looking for code insight
(Oct 5, 2014 08:02 AM)Kappa Wrote:  You're so gay. wink wink nudge nudge*

Shut up, you're the gay one :) :P
blushes like a fag *


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by HackersFeb 3, 2025 08:24 AM 0 168 Feb 3, 2025 08:24 AM
Last Post: Hackers
[Python] by CyberErrorAug 6, 2018 09:24 PM 6 142 Aug 6, 2018 09:24 PM
Last Post: CyberError
[C] by BulgarianFeb 28, 2016 02:00 PM 5 205 Feb 28, 2016 02:00 PM
Last Post: Bulgarian