Thomas_27 0 Newbie Poster

New to asking help but I'm desperate. I have most of the code I just need advice and also how to put the value from the file into the array and then pass to the functions without using any strings or string header. Basically trying to make this work and I'm stuck.

#include <iostream>
#include <iomanip>
#include <fstream>

//Array Size Set
const int ARRAYSIZE = 25;

using namespace std;

//Declaring Function Prototypes
char findComplement(char,char);
char findmRNA(char,char);
bool isPalindrom();
char displayResults(char,char,char);

int main()
//Declaring Arrays with constant size of 25
char dnaArray[ARRAYSIZE];
char comArray[ARRAYSIZE];
char rnaArray[ARRAYSIZE];

    int size=0;
    int i=0;
    char aChar;
    char n;
    char base;
    char comp;
    char temp;

//Opening text file that is in the same folder
ifstream inFile;"dna.txt");

//Making sure the file will open and not the end of file

    cout << "Cannot Compute Error Error" << endl;
    return 0;
        }//ending if statement
    aChar = temp;// trying to put a temp value for the array so I may get more letters one at a time and store them

    char findComplement(char dnaArray, char compArray);
    char findmRNA(char dnaArray, char rnaArray);
    bool isPalindrom(char dnaArray[],char rnaArray[]);
    char displayResults(char dnaArray,char comArray, char rnaArray);

    return 0;

char findComplement(char dnaArray[],char compArray[],int size);


//a switch to change the DNA to its complement
    case 'A':
        compArray[i] = 'T';
    case 'T':
        compArray[i] = 'A';
    case 'G':
        compArray[i] = 'C';
    case 'C':
        compArray[i] = 'G';
// Function to Find the mRNA
char findmRNA(char dnaArray[],char rnaArray[]int size);

    if(compArray[i] = 'T')
    compArray[i] = 'U';
//Declaring a bool function to accept true or false
bool isPalindrome(char dnaArray[],char rnaArray[],int size)
    for(int i = 0; i<size/2; i++)
        if (dnaArray[i] != compArray[size - 1 - i])
        return false;
        }//ending if statement

    }//ending for loop
    return true;
}//ending bool function

//Creating a function to display the result of the arrays
char displayResults()
cout << "DNA:" << endl;
cout << '   ' << dnaArray << endl;
cout << '   ' << compArray << endl;
cout << "mRNA:" << endl;
cout << '   ' << rnaArray << endl;
if(isPalindrome = true)
    cout << "The DNA strand is a palindrome." << endl;
    cout << "The DNA strand is not a palindrome." << endl;
}//ending displayResults function
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.