2 Attachment(s)
I'm confused, can someone help me?
Assignment:
You’ll need to make sure you have the following functions included. A description of
each is below:
void read(string s[], int r[][8]); - Opens and reads from a file called bcs.txt. See above for
data format on each line of the file. The school name is stored in the s array. The
rankings are stored in the r array. This includes the Coaches points, Harris points, and six
computer rankings.
void cleanse(string s[]); - Goes through each cell of the string array, and looks at each
school’s name. It looks to see if there is an underscore anywhere in the name. If so, the
underscore is replaced with a space.
void score(int r[][8], double s[]); - For each row of 8 cells, determine the BCS score.
void sort (string s[], int r[][8], double sc[]); - Looking at the BCS scores, sort the list of
teams, rankings, and scores from highest score to lowest score. To aid in readability, you
might consider writing some helper functions and using them here.
void print(string s[], int r[][8], double sc[]); - Print out the school’s name, BCS score, and
rankings (see screen shot), one per line.
my code:
Code:
#include<iostream>
#include<fstream>
#include<bcs.txt>
using namespace std;
/*(void read(string s[], int r[][8]); - Opens and reads from a file called bcs.txt. See above for
data format on each line of the file. The school name is stored in the s array. The
rankings are stored in the r array. This includes the Coaches points, Harris points, and six
computer rankings.
*/
(void read(string s[], int r[][8]);
ifstream inFile;
inFile.open("bcs.txt");
cout<<s[]<<r[][8]<<endl;
inFile.close();
return 0;
/*void cleanse(string s[]); - Goes through each cell of the string array, and looks at each
school’s name. It looks to see if there is an underscore anywhere in the name. If so, the
underscore is replaced with a space.
*/
void cleanse(string s[]);
for(string s=0,s<s1,length();s++){
if(s1[s]==' ')
}
//void score(int r[][8], double s[]); - For each row of 8 cells, determine the BCS score.
void score(int r[][8], double s[])
(coaches + harris + computer)/3
/*void sort (string s[], int r[][8], double sc[]); - Looking at the BCS scores, sort the list of
teams, rankings, and scores from highest score to lowest score. To aid in readability, you
might consider writing some helper functions and using them here.
*/
/*void print(string s[], int r[][8], double sc[]); - Print out the school’s name, BCS score, and
rankings (see screen shot), one per line.
*/
I'm lost...