jel04h
2/5/2017 - 9:23 PM

Randomizing w/ Math.floor((Math.random() * 10) + 1);

Randomizing w/ Math.floor((Math.random() * 10) + 1);

function trueOrFalse() {
	var oneOrTwo = Math.floor((Math.random() * 2) + 1);
	if (oneOrTwo === 1) {
		return true;
	} else if (oneOrTwo === 2) {
		return false;
	}
}
function randomSSN() {
	function oneRandDigit() {
		var theNum = Math.floor((Math.random() * 9) + 1);
		var stNum = theNum.toString();
		return stNum;
	}
	var randomThreeDigitNum = oneRandDigit() + oneRandDigit() + oneRandDigit();
	var randomTwoDigitNum = oneRandDigit() + oneRandDigit();
	var randomFourDigitNum = oneRandDigit() + oneRandDigit() + oneRandDigit() + oneRandDigit();
	var completeSSN = randomThreeDigitNum + "-" + randomTwoDigitNum + "-" + randomFourDigitNum;
	return completeSSN;
}

console.log(randomSSN());
var firstNamesMale = ["James", "John", "Robert", "Michael", "William", "David", "Richard", "Joseph", "Thomas", "Charles", "Christopher", "Daniel", "Matthew", "Anthony", "Donald", "Mark", "Paul", "Steven", "George", "Kenneth", "Andrew", "Joshua", "Edward", "Brian", "Kevin", "Ronald", "Timothy", "Jason", "Jeffrey", "Ryan", "Gary", "Jacob", "Nicholas", "Eric", "Stephen", "Jonathan", "Larry", "Scott", "Frank"];
var firstNamesFemale = ["Mary", "Patricia", "Jennifer", "Elizabeth", "Linda", "Barbara", "Susan", "Jessica", "Margaret", "Sarah", "Karen", "Nancy", "Betty", "Dorothy", "Lisa", "Sandra", "Ashley", "Kimberly", "Donna", "Carol", "Michelle", "Emily", "Helen", "Amanda", "Melissa", "Deborah", "Stephanie", "Laura", "Rebecca", "Sharon", "Cynthia", "Kathleen", "Shirley", "Amy", "Anna", "Angela", "Ruth", "Brenda", "Pamela", "Virginia"];
var lastNames = ["Smith", "Johnson", "Williams", "Brown", "Jones", "Miller", "Davis", "Garcia", "Rodriguez", "Wilson", "Martinez", "Anderson", "Taylor", "Thomas", "Hernandez", "Moore", "Martin", "Jackson", "Thompson", "White", "Lopez", "Lee", "Gonzalez", "Harris", "Clark", "Robinson", "Walker", "Perez", "Hall"];

function randomFirstName() {
	var mOrF = Math.floor((Math.random() * 2) + 1);
	if (mOrF === 1) {
		var numMan = Math.floor((Math.random() * firstNamesMale.length));
		return firstNamesMale[numMan];
	} else if (mOrF === 2) {
		var numWom = Math.floor((Math.random() * firstNamesFemale.length));
		return firstNamesFemale[numWom];
	}
}

console.log(randomFirstName());

function randomLastName() {
	var numLastName = Math.floor((Math.random() * lastNames.length));
	return lastNames[numLastName];
}

console.log(randomLastName());
var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"];

function randomDOB() {
	var randomMonth = months[Math.floor((Math.random() * months.length))];
	var randomDay = function() {
		if (randomMonth === "Feb") {
			var theDate = Math.floor((Math.random() * 28) + 1);
			return theDate;
		} else if (randomMonth === "Apr" || "Jun" || "Sept" || "Nov") {
			var theDate = Math.floor((Math.random() * 30) + 1);
			return theDate;
		} else {
			var theDate = Math.floor((Math.random() * 31) + 1);
			return theDate;
		}
	};
	var randomYear = Math.floor((Math.random() * (2016 - 1900) + 1) + 1900);
	var finishedDate = randomMonth + " " + randomDay() + ", " + randomYear;
	return finishedDate;
}