primes generates

advertisement
1. Create a code which adds 2(or 3) numbers.
2. Create a code which calculates the perimeter and the area of a rectangle
(triangle, square).
3. Create a code which calculates the roots of a quadratic equation.
To test the program, pick the following coefficients: a=2, b=-2, c=-12.
4. Create a code which calculates the area of a triangle. Use Heron's Formula: (
and
)b
5. Create a code which calculates the side c of a triangle if you know the sides a
and b, and the angle between the two known sides g.
(Use the law of cosines:
)
6. Pick a random number then create a code, which could decide, whether the
picked number is positive, negative, or either zero.
7. Generate a random integer number between 1 and 12. This number should
represent one month of the year. Create a code which tells us the season of
the month, what we generated previously.
8. Generate a random grade. Write the grade with number and text, too. (1 –
fail, 2 - pass, 3 - satisfactory, 4 - good, 5 – excellent).
9. Calculate the sum of two numbers and the difference of these two numbers
and put a number control X to the Front Panel. If the value of this control X
is equal to 0 then display the sum, otherwise the difference of the two
numbers.
10.Assume that you must cure a material in a furnace. The quality of the
material will be good if the temperature of the furnace T is between T min and
Tmax. If T>Tmax or T<Tmin then the program should alert (switch on a led) and
write out an error message (Heatstroke Warning, Freeze Warning, No
Warning - Warning Text)
11.Create a code which simulates the switching on and off a light bulb.
12.Create a code which imitates the water pouring into a tank which volume is
1000 litres. If you switch on a toggle then pour 1 litre water into the tank. If
you switch off the toggle then pour out 1 litre water from the tank. If the tank
is full or empty then stop the program running. (Control the loop execution
rate. 10 milliseconds lapse when the VI runs.)
13.Add together the first 100 natural numbers and write out the result.
14.Type an integer number between 1 and 100 to a number control. Create a VI
that continuously generates random numbers between 1 and 100 until it
generates a number that matches the number selected by the user. Determine
how many random numbers the VI generated before the matching number,
namely write the number of iterations.
15.Generate a random number integer between 1 and 100 by computer. Then try
to find out what is this number. If you type a number, the computer displays
one of the 3 possible answers: Your number is greater than mine; Your
number is less than mine; You have found out. Stop the program, if you have
found out the generated number. (Write the number of iterations.)
16.Create a code which decides about a natural number, is it prime number or
composite one!
17.Create a VI that calculates the square root of a Number which is entered by
the user. If the Number is positive, the VI executes the True case and returns
with the square root of the Number. If the Number is negative, the VI
executes the False case, return -9999, and displays a dialog box with the
message “Error … Negative number”.
18.There are some lamps in the flat. Create a code which imitates the turning on
and off of the lamps and counts how many of them are in state on.
19.Put 8 LEDs in one row. Create a code which imitate that the LEDs turn on
after each other.
20.Put 8 toggles on the Front Panel. Some of them are state on and some of
them are state off. Regard them as the 8 bits of a byte. Convert the binary
number to decimal.
21.Plot of the function sin x.
Download