取消
显示结果 
搜索替代 
您的意思是: 

Convert Random Number to Letter

已解决!
转到解答

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 项奖励
1 条消息(共 4 条)
3,616 次查看
解答
已被主题作者 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
2 条消息(共 4 条)
3,601 次查看

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! 高兴表情

0 项奖励
3 条消息(共 4 条)
3,592 次查看

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 项奖励
4 条消息(共 4 条)
3,525 次查看