Oct 4, 2014 11:18 PM
(This post was last modified: Oct 5, 2014 02:44 PM by R҉eece҉.)
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
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.");
}
}
}


![[Image: SKhvDZH.png]](https://i.imgur.com/SKhvDZH.png)
![[Image: QiUbeYa.png]](https://i.imgur.com/QiUbeYa.png)
