LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ranking Students Grade - LabView Error

As has been said, your code has significant faults and we cannot really help in detail, because we are missing important information.

 

  • How can you ever get "no result" as letter grade? The weighted average would need to be negative. Is that allowed? Are the various exam results always guaranteed to be in the range 0..100?
  • You have gaps in your logic, for example averages in the range of XX.9 and XX.99999999 are missed as has been pointed out.
  • What is the purpose of the second loop. The rank can only be calculated if the input is sorted by average, which it is not. Reversing the array makes no sense. Should the final array be sorted by rank, by student name, or in the original order?

 

 

 

 

0 Kudos
Message 11 of 15
(714 Views)

Since you seem to prefer pictures instead of VIs (else you would have attached your VI and some typical data! 🙂 ), here's a "picture" of one possibility:

 

(If you want the output in a different sort order a few small modifications should do it)

 

altenbach_0-1663745379067.png

 

0 Kudos
Message 12 of 15
(709 Views)

@altenbach wrote:

Since you seem to prefer pictures instead of VIs (else you would have attached your VI and some typical data! 🙂 ), here's a "picture" of one possibility:

 

(If you want the output in a different sort order a few small modifications should do it)

 

altenbach_0-1663745379067.png

 


Missing tie ranks.  Needs a threshold to rank ties to lower rank and skip next. i.e. grades 95, 95, 80, 80, 70 should rank 1, 1, 3, 3, 5.  Use 100 - Grades[] sorted as with ANY LEAST ERROR calculation  


"Should be" isn't "Is" -Jay
0 Kudos
Message 13 of 15
(691 Views)

Well, tie ranks are not mentioned in the poor problem description, but could be implemented with tiny code changes. I won't go far past a code skeleton until all requirements are outlined. 🙂

 

Should the rank be based on weighted average or letter grade? How many matching decimal digits are needed to consider two floating point values "equal enough" for a tie? What a can of worms!

0 Kudos
Message 14 of 15
(675 Views)

Rank is a least error problem or, it is not rank.


"Should be" isn't "Is" -Jay
0 Kudos
Message 15 of 15
(646 Views)