PLEASE DON\'T COPY PASTE MY CODE, ITS PLAGIARISM AND I AM JUST LOOKING FOR HELP.
ID: 3533861 • Letter: P
Question
PLEASE DON'T COPY PASTE MY CODE, ITS PLAGIARISM AND I AM JUST LOOKING FOR HELP. I WORKED HARD TO BUILD THIS PROGRAM #include #include #include #include #include using namespace std; void occurrence (char[], int[]); void initialize (char []); void sorts( char[], int[]); double percent ( char[], int[]); //void Printlanguage (char[], int[], int); const int MAXSIZE = 100000; const int alphabet = 26; int main() { ifstream infile;//infile2,infile3,infile4; infile.open("input2.txt"); //infile2.open("input2.txt"); //infile3.open("input3.txt"); //infile4.open("input4.txt"); //ofstream outfile; //outfile.open("output6.text"); char fill[100000]; int a[26]; char alpha[26]; char c = 'a' ;// { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k','l', 'm' ,' n ', 'o', 'p','q','r','s','t','u','v','w','x','y','z'}; bool flag= true; int i; int j; double Percent; // int k; //double Percent[26]; // int rp[alphabet]; for (j = 0; j < alphabet; j++) { a[j] = 0; } if(infile.fail()){ cout<< " cannot read file " << endl; } for (i = 0; (!infile.eof()&&i<100000); i++) { infile>> fill[i]; } cout << " to compute the percent input 1 and to continue the function input 0 " << endl; cin >> flag; // if ( flag == true) { for(int i =0;i<26;i++){ //a[i]=('a'+ i); } Percent= percent(alpha,a); cout<< "percent is " << Percent << " " << alpha[i] << endl; } } occurrence(fill,a); initialize(alpha); sorts(alpha,a); /*for (int k = 0; k < alphabet; k++){ double Percent[MAXSIZE]; } */ //Printlanguage(alpha, a, i); // output both frequency and the language in there not in the funtions return 0; } void occurrence (char fill1[], int a1[]) { int o, n; char temp; for(n=0; n<100000; n++){ temp=fill1[n]; a1[temp-'a']++; } for(o=0; o<26; o++) { a1[o]; } } void initialize (char alpha1[]) { int v; for ( v = 0; v < alphabet; v++){ alpha1[v] = (char)v+97; } } void sorts(char alpha2[], int a2[]) { //bool truth = true; int passcount; // a loop control variable int placecount; // a loop control variable int mIndex; // index (subscript of min value so far) double temp,dp; // temporary value used for swapping for (passcount=0; passcount a2[mIndex]) mIndex = placecount; } // swap a[mIndex] and a[passcount] temp = a2[mIndex]; a2[mIndex] = a2[passcount]; a2[passcount] = temp; dp = alpha2[mIndex]; alpha2[mIndex] = alpha2[passcount]; alpha2[passcount] = dp; } cout << endl; /// cout << ; come back to for (int w = 0; w < alphabet; w ++) { /*if(w==0){ truth=true; }else{ truth=false;*/ cout << "the frequency in the arrays are as follow " << alpha2[w]<< " " <Explanation / Answer
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.