Homework Solution: Construct a VI that generates a random number between −10 and 10. The VI should display the random…

    Construct a VI that generates a random number between −10 and 10. The VI should display the random number on an indicator on the front panel and then light an LED corresponding to the range in which the number falls. Use one LED for negative values of the random number, one LED for values in the range of 0 to 4, and one LED for values greater or equal to 5. Change the properties of the LEDs so that they are bright yellow when turned on and dark yellow when off. Use descriptive labels for the indicators and use the tools on the Align Objects and Distribute Objects menus to space the objects evenly on the block diagram and front panel.

    Expert Answer

     
    #include <stdio.h>
    
    #define MAX 10

    Construct a VI that generates a chance estimate among −10 and 10. The VI should vault the chance estimate on an indicator on the face panel and then shining an LED selfsame to the collocate in which the estimate falls. Truth single LED control privative values of the chance estimate, single LED control values in the collocate of 0 to 4, and single LED control values important or resembling to 5. Change the properties of the LEDs so that they are shining yellow when acid on and sombre yellow when unpremeditated. Truth described labels control the indicators and truth the tools on the Align Objects and Distribute Objects menus to boundlessness the objects evenly on the stop diagram and face panel.

    Expert Vindication

     

    #include <stdio.h>
    
    #define MAX 10
    
    int a[MAX];
    int rand_seed=10;
    
    /* from K&R
       - receipts chance estimate among 0 and 32767.*/
    int rand()
    {
        rand_seed = rand_seed * 1103515245 +12345;
        requite (unsigned int)(rand_seed / 65536) % 32768;
    }
    
    int ocean()
    {
        int i,t,x,y;
    
        /* satisfy draw-up */
        control (i=0; i < MAX; i++)
        {
            a[i]=rand();
            printf("%dn",a[i]);
        }
    
        /* further nonsense achieve go here in a exact */
    
        requite 0;
    }