Guy or Girl? Im stumped.... (with pics)

import Math.java;

public class Guyorgirl{

public Static void main(String[] args) {

int gender = Math.random() * 2;

if (gender == 1) {

system.out.println("Its a guy");

}

else {

system.out.println("its a girl");

}

}
 
import Math.java;

public class Lolwut {

protected String gender;

protected int sex;

public Lolwut(){

sex = (int) (Math.random()*3);

}

public String getGender(){

if (sex == 1) {

return "male";

} else if (sex == 2) {

return "female";

} else {

return "WTF?";

}

}

}

public class Guyorgirl extends Lolwut {

public Static void main(String[] args) {

boolean wtf = true;

Lolwut lw = new Lolwut();

gender = lw.getGender();

if (!wtf){

System.out.println(gender);

} else {

System.out.println("WTF?");

}

}

}

My code is more reusable than yours, ha-ha! You're a second-rate programmer, I am INVINCIBLE!
 
would it be going too far if i made a program going all out using the java.util.scanner and shit to get the user to choose like heads or tails?
 
I debated it, but decided just to rock it that way... but I don't think implementing a scanner would be all that tough. It'd just be sticking this into your code, and then setting the final printout with an if (dudeOrChick == ..... else setup

public int dudeOrChick;

Scanner scan = new Scanner();

System.out.println("Type /"1/" for dude, /"2/" for chick");

dudeOrChick = scan.nextInt();
 
pix4.jpg
 
Back
Top