Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions gender
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import java.util.*;
/**
* Write a description of class gender here.
*
* @author (your name)
* @version (a version number or a date)
*/
//abstract public class Gender
public class Gender
{
// instance variables - replace the example below with your own
private String male;
private String female;
private String gender;
private int sexProbablity;
private List<String>gender_list =new ArrayList<>();

/**
* Constructor for objects of class gender
*/
public Gender()
{
male = "Male";
female = "Female";
gender_list.add(male);
gender_list.add(female);
}

/**
* An example of a method - replace this comment with your own
*
* @param y a sample parameter for a method
* @return the sum of x and y
*/
//abstract public String born_sex();
public String born_sex()
{
Random rand = new Random();
int i = rand.nextInt(gender_list.size());
gender = gender_list.get(i);
return gender;
}