Yes, I changed lowest to int in calcAverage.
Re: the thing that was suggested to fix the e notation (fixed manipulator) - the program crashes before outputting the numbers when I include this.
Yes, I changed lowest to int in calcAverage.
Re: the thing that was suggested to fix the e notation (fixed manipulator) - the program crashes before outputting the numbers when I include this.
In your "main", right after you get the 5th number, simply print the 5 numbers. If you get the same output as your previous post, then change every "double" to "float" and try again. Let me know the outcome.
Okay, after changing the doubles to floats, the program no longer crashes when outputting the scores, but the numbers are still a problem.
Here is a sample run:
Please enter a test score. 4
Please enter a test score. 6
Please enter a test score. 0
Please enter a test score. 5
Please enter a test score. 2
182395222651967080000000000000000.000000
0.000000
0.000000
0.000000
3
Four highest test scores: 182395222651967080000000000000000.000000, 0.000000, 0.000000, 0.000000
Average: 455988056629917710000000000000000.000000
Post your updated function that gets the numbers, the problem seems to lie in there I think.
Here is getScore:
Code:void getScore(float &tscore) { float score; cout << "Please enter a test score. "; cin >> score; while (score < 0 || score > 100) { cout << "Valid test scores range from 0 - 100.\n"; cout << "Please enter a test score. "; cin >> score; } }
You still havent done this, which is the root of the problem.
After you fix that, you should be able to use either all "floats" or all "doubles", as the problem is in this function above, not the types.
I offer my time to explain things in the hope that you will read it, learn or understand it, and apply it. If I just tell you every step then you dont learn.
Nadroj,
Thank you, it's finally working!
I've really appreciated all the time you've taken to help me and especially how patient you've been. I know I've been asking a lot of questions and I made a lot of mistakes, but it's only been because I wanted to learn, not because I wanted anyone to tell me how to do everything. And I did learn. I was confused about the reference parameter because the material in my book is vague. I'd been stuck on this for days and consulted a friend for help before I decided to post here. I'm sorry if I tried your patience, but I really appreciate all the help you gave me and I have learned. Thanks again.
No worries, as long as you did learn something in the end.