The Code is as Follows
as theya re not included in this code i have given an outline of two previous functions which join on the program i wrote previously
Int totalrec=2
maxsize of the arrays = 300
currently stored values is 3 with 2 having titles and prices
being value 1 and value 2
Basically i need help to write this function
any information can be provided easily
basically i know if it doesn't occur Return False;
else Return true;
as the data is currently stored in two elements we can check those two ideally though a function to potentially check all possible slots would be better
i was thinking an I++ until == 300
Any Help would Be Greatly Appriciated Thanks
I Realised that a check is needed on array all titles with a cin string search so maybe a linear search type function possibly. if so how to define this ?
Code:
bool findTitlePrice(string allTitles[], double allPrices[], int totalRec, string title, double & price) { for(int i=0; i < totalRec; i++) { // your code here: // for each element of array allTitles, check if it matches // the given title, i.e. if title and allTitles[i] are the same; // if yes, fetch the corresponding price from // the array allPrices and exit the function (returned value: true) } // your code here:
Int totalrec=2
maxsize of the arrays = 300
currently stored values is 3 with 2 having titles and prices
being value 1 and value 2
Basically i need help to write this function
any information can be provided easily
basically i know if it doesn't occur Return False;
else Return true;
as the data is currently stored in two elements we can check those two ideally though a function to potentially check all possible slots would be better
i was thinking an I++ until == 300
Any Help would Be Greatly Appriciated Thanks
I Realised that a check is needed on array all titles with a cin string search so maybe a linear search type function possibly. if so how to define this ?
Comment