I have a question on the below coding which I could not figure out. I have to enter the Instructor ID and invokes getFees to find the fees of the given instructor. Then it will displays the message that shows either the fees or "No such instructor ID" if not found. the function prototype is double.getProfessionFees(string);
You could start by actually answering the question you were asked:
What are you trying to do here?
People don't ask questions because they like the sound of their fingers hitting the keyboard. They ask questions because if we can understand more about your problem, we can help you better.
If you're just going to ignore what people say in your thread, why shouldn't we just ignore you likewise?
I'm trying to do search engine which then to key in the Instructor ID which is the build in the array of S001, S002 .... and S007 which is the instructor ID. Then with the ID it will display the name of the instructor and invokes then display getFees to find the fees of the given instructor getFees = basicFees - discountRate * basicFees.
discountRate will be {10, 20, 30, 40, 50, 60, 70}
basicFees = {100, 200, 300, 400, 500, 600, 700}
So, your instructor ID's are clearly strings, rather than individual characters. So:
- it makes no sense to have it as a one dimensional array of characters. It should be an array of strings.
- the values you populate that array with should be strings, e.g.
[code]{"S001","S002",... } [code]
just as TarikNeaj showed you. Of course, you'll then need to make sure anything that uses that array is using it as the correct type of array, e.g. your search function will need to take the correct type of array.
Beyond that, well... "it still doesn't work" isn't really a very helpful thing to tell us. What errors are you seeing? What lines are causing those errors?