Question
How can I go about this? This is my code... //HW12 #include #include #include using namespace std; //Creating struct of footBallPlayerType struct footBallPlayerType{ string name;
How can I go about this? This is my code...
//HW12
#include #include #include
using namespace std;
//Creating struct of footBallPlayerType struct footBallPlayerType{ string name; string position; int touchdown; int catches; int pass_yards; int receive_yards; int rush_yards; };
//Creating functions //function to show Menu void showMenu(){ cout
//function to read a file void getData(ifstream &inputFile,footBallPlayerType list[],int size){ //index to update list int i=0; string nm,pos; int to,ca,pa,re,ru; while(i>nm>>pos>>to>>ca>>pa>>re>>ru){ list[i]={nm,pos,to,ca,pa,re,ru}; i++; } }
//function to save data void savedata(ofstream &output,footBallPlayerType list[],int size){ output
//function to print Data void printData(footBallPlayerType list[],int size){ cout
//function to print Player's Data void printPlayerData(footBallPlayerType list[],int index){ cout
//Search data of player int searchData(footBallPlayerType list[],int size,string name){ for(int i=0;i if(list[i].name==name){ return i; } } return -1; }
//Updating touchdowns void UpdateTouchDowns(footBallPlayerType list[],int td,int index){ list[index].touchdown=td; }
//Updating Catches void UpdateCatches(footBallPlayerType list[],int ca,int index){ list[index].catches=ca; }
//Updating Passing void UpdatePassing(footBallPlayerType list[],int pa,int index){ list[index].pass_yards=pa; }
//Updating Receiving void UpdateReceiving(footBallPlayerType list[],int re,int index){ list[index].receive_yards=re; }
//Updating Rushing void UpdateRushing(footBallPlayerType list[],int ru,int index){ list[index].rush_yards=ru; }
int main() { //Reading the file ifstream file("PackersData.txt"); int size;file>>size; footBallPlayerType list[size]; getData(file,list,size); bool flag=false; //Testing while(true){ showMenu(); cout>choice; cout>name; index=searchData(list,size,name); if(index==-1){ cout>name; cout>num; index=searchData(list,size,name); if(index==-1){ cout>name; cout>num; index=searchData(list,size,name); if(index==-1){ cout>name; cout>num; index=searchData(list,size,name); if(index==-1){ cout>name; cout>num; index=searchData(list,size,name); if(index==-1){ cout>name; cout>num; index=searchData(list,size,name); if(index==-1){ cout
input and output:
HOMEWORK #13-Header Files split the user-defined functions from HW #12 into two user-defined . cpp source files and . h header files, respectively. Place the functions that update information about the team or player (the five update functions) into an updatePlayer.cpp file and all other functions (aside from the main function) into an updateData.epp file. Create the appropriate header files, as necessary Re-compile your code and make adjustments until the program works identically to HW #12. HOMEWORK #13-Header Files split the user-defined functions from HW #12 into two user-defined . cpp source files and . h header files, respectively. Place the functions that update information about the team or player (the five update functions) into an updatePlayer.cpp file and all other functions (aside from the main function) into an updateData.epp file. Create the appropriate header files, as necessary Re-compile your code and make adjustments until the program works identically to HW #12Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started