LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Clusters & Arrays

Solved!
Go to solution

Can anyone help me with this problem? I am very close but I cannot figure out what I need to make my VI function correctly. I am sure it is something simple that I am not seeing. Attached is my current VI. 

 

 

Design a VI that produces an array of clusters containing the course average, letter grade, and class rank for each student in a class, given three arrays with the examination scores as input. There is one array of scores for each examination. The course average is determined as follows: 30% from the first exam, 30% from the second exam, and 40% from the final exam. The letter grade is determined from the course average by the criteria listed in Table D6.2.

TABLE D6.2 Course Average Criteria

Course Average

Letter Grade

0% - 59%

F

60% - 69%

D

70% - 79%

C

80% - 89%

B

90% - 100%

A

Rank the students so that the student with the highest grade has a rank of 1 and the student with the lowest grade in the class has a rank equal to the number of students in the class. You may wish to use the Sort ID Array and Search ID Array functions within a loop to establish the student ranks.

Bundle all of the information (course average, letter grade, and class rank) into an array of clusters where each cluster contains all the data for one individual student. Display this array of clusters on the front panel.

Test the VI with different inputs to verify its functionality. Since the array of clusters will become very large for a class with more than a few students, space can be conserved on the front panel by showing only one element of the output array at a time and then using the index display to scroll through the different elements of the cluster array.

0 Kudos
Message 1 of 15
(1,894 Views)

First of all, your averages are floating point numbers, so you have gaps (e.g. if the score is 69.5, you have no case. Do you round down? To nearest? Case structures expect integers (notice the red coercion dot?). Typically is is easier to threshold into an array of levels and then index into an array of letter grades.

 

If attaching a VI, you should make sure that the controls have reasonable default values, so we don't need to guess. Empty arrays are not reasonable.

 

You probably want to autoindex at the output tunnel of the seconds FOR loop. Currently, you only get the last cluster and turning it into an array of one element seems pointless right?.

 

You should NOT wire N of the first FOR loop. It should run for the size of the array and will known when to stop. If you wire N, it will not process more than five elements.

 

You also need to deal with the possibility that two students have the exact same average. They would need to get the same rank, skipping some ranks later. (e.g. [alpha, Rank 1, 89%], [beta, Rank 1 98%], [gamma, Rank 3, 88%])

Message 2 of 15
(1,872 Views)

@altenbach wrote:

First of all, your averages are floating point numbers, so you have gaps (e.g. if the score is 69.5, you have no case. Do you round down? To nearest? Case structures expect integers (notice the red coercion dot?). Typically is is easier to threshold into an array of levels and then index into an array of letter grades.


This sounds very familiar...

 

Didn't we go over this (exactly) a year ago? And two years ago... And 3...

 

Solved: Array into a case statement - NI Community

Solved: Beginner help with arrays. - NI Community

Solved: Cluster - NI Community

Solved: case structures and arrays - NI Community

convert number to letter for grade - NI Community

Basic covert grade percent to letter grade? - NI Community

 

Message 3 of 15
(1,807 Views)

I guess that course does not update the curriculum for years. 😄 It's a pretty good learning example though.

0 Kudos
Message 4 of 15
(1,791 Views)

Makes me wonder what the course average grade is by now?

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 5 of 15
(1,778 Views)

You'd like to think it had gone up with how many solved examples there are. 

0 Kudos
Message 6 of 15
(1,769 Views)

@LVIEWPQ wrote:

You'd like to think it had gone up with how many solved examples there are. 


I am sure the teacher knows all these examples and will recognize if students just plagiarize the examples without creative input. 😄

0 Kudos
Message 7 of 15
(1,731 Views)

@altenbach wrote:

@LVIEWPQ wrote:

You'd like to think it had gone up with how many solved examples there are. 


I am sure the teacher knows all these examples and will recognize if students just plagiarize the examples without creative input. 😄


Or they teach how to search the forum in the last lesson.

0 Kudos
Message 8 of 15
(1,700 Views)

Hello,

 

Can some point out where the issue is for the student to finish up where they left off. With this design, the student needs straight solution, so it will great point out what is needed to be add and where. I guess it will help other who are trying to solve similar problem from the LabVIEW textbook.

Thank you all for your great work.

0 Kudos
Message 9 of 15
(1,437 Views)

@niibi wrote:

Hello,

 

Can some point out where the issue is for the student to finish up where they left off. With this design, the student needs straight solution, so it will great point out what is needed to be add and where. I guess it will help other who are trying to solve similar problem from the LabVIEW textbook.

Thank you all for your great work.


If you scroll back up a couple of posts, there are 6 solutions linked. 

0 Kudos
Message 10 of 15
(1,387 Views)