09-19-2022 07:28 PM
Hello I am trying to rank students grade with a program and I am not being able to connect everything to my results array. I don't know what to change. Help please 😞
09-19-2022 07:42 PM
Hi Irene,
@irenedgl wrote:
I am not being able to connect everything to my results array. 😞
Because there is no "result array"!
Make an array from your output cluster...
09-19-2022 10:20 PM
How do I do that? I thought my array "Students Results" that would be connected to the output cluster would be the results array. I am confused.
09-20-2022 12:38 AM
Hi Irene,
@irenedgl wrote:
How do I do that? I thought my array "Students Results" that would be connected to the output cluster would be the results array. I am confused.
I'm sorry, when answering from phone I thought your "output cluster" would be connected to the last FOR loop...
As you chose to not attach your code you need to debug on your own: which error explanation is shown (in the context help) when you move the mouse over the broken wire?
Keep in mind: we cannot debug/edit/run images with LabVIEW!
09-20-2022 01:49 AM - edited 09-20-2022 01:51 AM
The loop will iterate exactly as many times as the input array is long, in this case Zero!
No, the 5 won't change that, but it will limit it to 5 should your input be longer.
Also, it looks like your Output cluser is the same as the result array, but since they're not a type def (make it a type def) they might have different Tab order, which'll cause a broken wire.
09-20-2022 02:21 AM
I feel like the others didn't get to the point. It seems like you redefined the clusters content during writing the code. I can't see what, the code seems correct, but it might be something small. It might be that Output cluster 2 and Student results array have different contents. The easiest way now is to unwire the Student results array, right-click the indexing output terminal and select Create indicator, which will totally contain the correct data type.
In order to avoid these type mismatches, make typedef out of the cluster and replace every cluster instance with the typedef. Once you change the typedef, it gets propagated to every instance.
09-20-2022 03:56 AM
Deleting the output array and creating a new indicator will most likely solve the issue.
Otherwise, please attach your VI so that we can comfortably debug.
Fort
09-20-2022 09:05 AM
You are close. This is what I would do.
09-20-2022 09:42 AM - edited 09-20-2022 10:31 AM
@irenedgl wrote:
Hello I am trying to rank students grade with a program and I am not being able to connect everything to my results array. I don't know what to change. Help please 😞
Your code has serious problems. For example, what would the grade be for a student that scored 82.5, 84 100 on the tests? (24.75+ 24.2 + 40 = 89.95) That's never in range and your student gets No Grade! Those 40Q tests are pretty standard for an exam.
Let's rethink this using a lookup string array of "NG, F, D, C, B, A, A+" and index the array by "weighted average" /10 - 4
At the very least use the same value for LL and the next lower grade UL and enclude LL only except for the A range ( you want the 100 included there unless acing the course can only be done by cheating)
Let's rethink ranking students by acending name too! For that sort to work correctly the grade can be the only concern! If John Smith and Jane Doe both ace the course do you really want Jane to rank above John?
Hint: Use the floor of the threshold of a sorted array of 100 - average of each student's 100 - average
09-20-2022 11:43 PM
Maybe this will work for you, plus its written in the student edition for bonus irony points : )