LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert Random Number to Letter

Solved!
Go to solution

Hello,

I'm very new to LabVIEW, and I'm looking for a way to create a program which randomly assigns students a letter grade (A, A-, B+, etc). It was suggested to me that I start by creating a random number generator as shown. Using this, I am able to generate a random number between 1 and 10. Is there a way to take the number that is generated and convert it to the corresponding grade? For example, convert 1 to A, 2 to A-, etc. Alternatively, is there a better way to approach this task?

 

Thanks very much for the help. As I said, I'm new to LabVIEW and still trying to figure things out.

0 Kudos
Message 1 of 4
(2,705 Views)
Solution
Accepted by topic author MattieE

Use that number as an index into an array which contain your various grades.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 2 of 4
(2,690 Views)

Thanks very much! I figured the solution had something to do with creating an array of the possible grades, but I wasn't quite sure how to go about using that to get a single grade from a randomly generated number. This is exactly what I needed. I really appreciate it! Smiley Happy

0 Kudos
Message 3 of 4
(2,681 Views)

One of our missions here is to help LabVIEW novices grow.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 4
(2,614 Views)