I want to know how to pass value from constructor I have created to a function called void displayValue to display the object value created in the main part...here is my code
Unfortunately there are other problems with your code. For example, you are using a local instance of StudentRecord in calculateResult(). I'm sure you intend to use the values for the instance calling the function. An example of this is line 64: quiz1_percent = 1.00 *(result_percent.quiz1/10.0);
Which should be: quiz1_percent = 1.00 *(quiz1/10.0);// also, why multiply by 1.00 ?
Similarly for other lines in the function. This function also needs to return a double value since you declared that as the return type. If it doesn't need to return any value then change the return type to void.
There is also a logical error with findGrade(). If numeric_score < 90 the grade will always be a 'B', never 'C', 'D' or 'F'.
ok...i get what u mean, after removing all the result_percent , i still cant get the exactly output, the output is sumting strange number...and aso i place the displayValue(); in the constructor, it stil din display the content of the function void Student::displayValue() ..
I understanding the concept u have explained, but jst dun get the exactly matching idea, it's just sumting need to sort it out...i feel im more close to the solution
Enter first quiz mark:
7
Enter second quiz mark:
7
Enter midterm exam mark:
7.6
Enter final exam mark:
7.7
Total quiz marks : 4.83816e-312
Midterm : 3.01037e-307
Final Exam : 1.0123e+268
Course average score : 0
Your grade : ╨
Press any key to continue . . .
Other than the code being very messy, I also have troubles figuring out what's causing the problems. This kind of output is normally caused by using unitialized variables, but I can't seem to find which one you didn't init.
ya...i have been serching the whole way trying to figure it out...i knw the output shud be related to failure of passing variable,declaration or initialized, but every variable i have created seems being declared and initialized properly, cant get any idea...any other solutions are welcome
Very odd. I copied your code to my compiler and used the same values as you did. Here is the output I get:
The mark of quiz 1 and quiz 2 is : 8and9
Enter first quiz mark
7
Enter second quiz mark
7
Enter midterm exam mark
7.6
Enter final exam mark
7.7
Total quiz marks : 1.4
Midterm : 0.076
Final exam : 0.077
Course average score : 0.4075
Your grade : B
Press any key to continue . . .
These are the results I'd expect from your code.
I can't imagine why you aren't getting these results. You did build and run the new code, right?
What you got looks like what I'd expect from the old code.
it's working!!! after rebuilding the file, it works exactly wat u display, thx for ur help, but i stil duno how to modify the course average score floating point to become exactly like mark percentage e.g : 40.75 .... and so do on midterm,quiz mark and so on...
You're welcome. Glad your program works now. You can now experiment with your formulas to get them right. That's a math issue, not a programming issue.
You may do well to focus more carefully on your work. I'd bet the carelessness displayed in your spelling is also affecting your programming.
ok...thx anyway...1 more ting i wanna know...since you are experience in writting C++ program, can you suggest anything I can do to so i can improve my programming skill and logical thinking? through exercise, books, working, or any other suggestions?