1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
/************************
Purpose of the Program: Read an input file for gene information and sort the information into different arrays to be reffered to to check for specific letters in specific location.
Input: "dna.txt"
Output: "DNAanalysis.txt"
Main Algorithm:
Assumptions: "dna.txt" will not be altered and only holds the gene info of four individuals.
Program Limitations: Hardcoded for the reading of four people and only four people at any given time.
************************/
#include <iostream>
#include <fstream>
using namespace std;
// Functions
void input(ifstream &); // Get input file dna.txt
void read(char[], char[], char[], char[], char[], char[], char[], char[], ifstream);
int main()
{
ifstream inFile;
ofstream outFile;
char Person1GeneA[444], Person1GeneB[444], Person2GeneA[444], Person2GeneB[444], Person3GeneA[444], Person3GeneB[444], Person4GeneA[444], Person4GeneB[444]; // Char arrays for each gene's data
input(inFile); // Opens input file dna.txt
read(Person1GeneA, Person1GeneB, Person2GeneA, Person2GeneB, Person3GeneA, Person3GeneB, Person4GeneA, Person4GeneB, inFile);
return 0;
}
// Functions
void input(ifstream & inFile) // Get input file dna.txt
{
inFile.open("dna.txt"); // attempt to open the input file
if (!inFile) // did it open?
{
cout << "Error opening input file dna.txt. Exiting program." << endl;
exit(0);
}
}
void read(char[], char[], char[], char[], char[], char[], char[], char[], ifstream inFile)
{
}
|