This answer assumes you are using a standard SQL Membership Provider and vanilla database. (And this is not really a SharePoint issue, this is more of a .NET issue you are implementing in a SharePoint context.)
Essentially, what you want to do is insert some rows into a database. There are a number of ways to access a database, but I prefer Entity Framework. EF creates a series of strongly typed entity classes that serve as your API into the database. I create users by mapping the Membership_CreateUser stored proc into an EF entity, and call it like this:
public static int CreateAUser(string appName, string username, string password)
{
int outResult = 0;
using (var db = new MembershipEntities( )) //the name of the EF context
{
var outputParam = new ObjectParameter("userId", typeof(int));
outResult = db.aspnet_Membership_CreateUser(appName, username, password, "", username, "", "", true, DateTime.Now, DateTime.Now, 0, 0, outputParam);
}
return outResult;
}
The sproc handles all the INSERT statements so you don't have to worry about all that's going on under the covers (but I highly recommend you examine the sproc so you know what's going on). The method will return the numeric ID of the database row created in the Membership table, which may or may not be useful to you. Intellisense (and peeking at the sproc itself) should help you figure out what all the parameters are for. Your needs might require a different configuration.
You can generate a password by calling the built-in function in System.Web.Security.Membership:
string password = Membership.GeneratePassword(8, 2);
// 8 characters, 2 non-alphanumeric characters
You would call the code like this:
Your.Code.Library.CreateUser("/", email, password);
Then, to put the user into that group:
SPUser theUser = elevatedSite.RootWeb.EnsureUser("i:0#.f|ext|" + email);
//you need to use EnsureUser in an elevated code block (which I assume you know how to do)
//that crazy string you see before the email is the claims prefix for the user where "ext" is the name of the membership provider registered in web.config
//you'll want to change that to whatever your environment uses
theUser.Name = string.Format("{0} {1}", userFirstname, userlastName);
//not really necessary but it's nice to have user names formatted nicely
theUser.Update();
//add the user to the group
SPGroup theGroup = elevatedSite.RootWeb.Groups["FBA Users"];
theGroup.AddUser(theUser);
theGroup.Update();
Lastly, and this might be beyond your scope or willingness to do, but I highly recommend putting all your membership data access code in a separate code library project. This will make it reusable and modular and will help with maintainability.
Entity Framework
http://msdn.microsoft.com/en-us/data/ee712907.aspx
Membership API
http://msdn.microsoft.com/en-us/library/system.web.security.membership(v=vs.110).aspx