LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to indicate the cluster data using a single id???


My teacher sent me this assignment.

I tried using the cluster, range comparison , arrays , and case structure.

But i couldn't put them together.

I would appreciate a little help.

Screenshot_20191112-170840.png

 

0 Kudos
Message 1 of 19
(2,540 Views)
  1. Build a Cluster with the items specified in the assignment.  If you do not know how to do this, learn (see your notes, read your textbook, go to the first page of this Forum and look at the tutorial material, particularly stuff about "clusters").
  2. Think about how you'd handle a class of 10 students -- what sort of data structure do you think you need?
  3. Figure out a way to create the data structure mentioned in #2.  Feel free to write a tiny bit of LabVIEW code to help you.
  4. Once you have this data structure, do the assignment, which is basically:
    1. Query the Data Structure based on Student ID.
    2. Retrieve correct Student record.  [How would you check to be sure you got the right one?]
    3. Compute average.
    4. Compute Letter Grade.
    5. Produce required output.

Bob Schor

 

P.S. -- if you get stuck, feel free to return, but you must attach the VI (or other LabVIEW code) you've created.  This will show that (a) you are doing your own work, and are not asking us to do your homework for you, (b) will tell us a bit about your LabVIEW environment, (c) will show us "where you are confused" so we can give appropriate help.  Please do not attach screen shots or "pictures" of code.

 

P.P.S. -- this is slightly advanced, so don't worry if it doesn't (yet) make sense.  Whenever I create a Cluster, I always make a TypeDef out of it, which allows me to "indicate the cluster data using a single ID".  I'm not sure if this is what you meant by the title of your Post, but once you get the idea of Clusters and how they are used, you might be interested in this "slightly advanced" topic.  Also, I strongly recommend that you use the "by name" versions of the Cluster functions "Bundle" and "Unbundle", as it helps in wiring the Cluster elements correctly (you are less likely to create a record where the "Student Name" is "A" and the "Grade" is "John Smith").

 

Message 2 of 19
(2,528 Views)

Hi Arash,

 

this seems like a pretty common assignment for students - did you even try to search this forum for related threads?

Or did you talk with your co-students about this problem?

(I have seen several threads with very similar problems lately…)

 

Why don't you attach your current VI to show what you have reached so far?

Do you think you will get your homework (and grade) for free?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 19
(2,527 Views)

I'd be using the Threshold 1D Array to convert the average to an index...

0 Kudos
Message 4 of 19
(2,519 Views)

The grade list is flawed. Which grade if they get exacly 59%?

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 19
(2,511 Views)

@Yamaeda wrote:

The grade list is flawed. Which grade if they get exacly 59%?

/Y


I don't know about the specific case from the OP but, in my case I passed the course, graduated and got a job programming LabVIEW!

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 6 of 19
(2,496 Views)

@Yamaeda wrote:

The grade list is flawed. Which grade if they get exacly 59%?

/Y


Good catch. (S)he'd lose my respect as a programming teacher. Unless it's deliberate of course, to see who's paying attention.

 

My C++ teacher lost my respect when she claimed you need a 3rd variable to swap two variables.

0 Kudos
Message 7 of 19
(2,478 Views)

It's pretty obvious.

If you pay a little attention you will see that 60_69 is a closed range

So below 59 actually means less than or equal to 59 or in other words a closed interval between 0_59.

So 59 is fail

0 Kudos
Message 8 of 19
(2,473 Views)

In this case i'd say it's between D and F and have a special case with grade 'E'. 😄

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 9 of 19
(2,472 Views)

"So below 59 actually means less than or equal to 59 or in other words a closed interval between 0_59"

No, below 59 means < 59, thus 0_58. 59 is undefined. 🙂

(yes, it probably is meant to mean 59 is failed, but if you're literal with the interpretation ...)

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 19
(2,461 Views)