hi everyone,
i am working on a simple C++ code that will randomly generate a DNA strand of bases. How this is what i have so far:
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
string my_string;
int main()
{
int random_integer;
char 1 = 'A';
char 2 = 'T';
char 3 = 'C';
char 4 = 'G';
cout << "Length of DNA to be generated is 20 bases." << endl;
{
srand((unsigned)time(0));
int lowest=1, highest=4;
int range=(highest-lowest)+1;
for(int index=0; index<20; index++)
{
random_integer = lowest+int(range*rand()/(RAND_MAX + 1.0));
cout << random_integer << endl;
}
}
{
cout<< "Now after every A there will be a C insertion (mutation)"<< endl;
string my_string = "A";
my_string.insert (1,"C");
}
{
cout<< "Now after every G there will be a T insertion (mutation)"<< endl;
string my_string = "G";
my_string. insert (1, "T");
}
return 0;
}
my problems are this:
1) when i try to compile (using borland) it keeps telling me declaration terminated incorrectly on line 9 and i cant figure out a way to fix it
2) is there a way to get it so you can imput how many bases the random genertor generates??
that is it... i hope someone can help me... I NEED IT QUICKLY!!!!!:mrgreen: Thank you so much in advance