2013年11月25日 星期一

實例演練題 


抄下後,鍵入於VB2010中,比較執行結果 
 
1.    Msgbox (8*3)
 
2.    Msgbox (8/3)
 
3.    Msgbox (8\3)
 
4.    Msgbox (8 mod 3)
 
5.    Msgbox (3 ^ 5)
 
6.    Msgbox (3/3*3) 
 
7.    Msgbox (3\3*3) 
 
8.    Msgbox (3+4*5-4)
 
9.    Msgbox (3+4*5^2-4)
 
10.  Msgbox (3+4)*5^2-4)
 
11. dim a = true :dim b = true

msgbox (a and b) 
 
12. dim a = true :dim b = true

msgbox (a or b) 
 
13. dim a = true :dim b = true

msgbox (a xor b) 
 
14. dim a = true :dim  b = true

msgbox (not(a xor b)) 
 
15. dim a = true :dim  b = false

msgbox (a and b) 
 
16.dim  a = true :dim  b = false

msgbox (a or b) 
 
17.dim  a = true : dim b = false

msgbox (a xor b) 
 
18. dim  a = true :dim  b = false

msgbox (not(a xor b)) 
 
19. dim a = false :dim  b = false

msgbox (a and b) 
 
20. dim a = false :dim b = false

msgbox (a or b) 
 
21. dim a = false : dim b = false

msgbox (a xor b) 
 
22. dim a = false : dim b = false

msgbox (not(a or b)) 
 
23 dim a = 3:dim  b =4 :dim c =5:dim  d=6

s = a>b and c>d

msgbox (s)
 
24 dim a = 3: dim b =4 :dim c =5: dim d=6

s = a>b or (d>c)

msgbox (s)
 
25 dim a = 3: dim b =4 :dim c =5: dim d=6

s = a>b and not(c>d)

msgbox (s)
 
26 dim a = 3: dim b =4 :dim c =5: dim d=6

s = a>b xor not(c>d)

msgbox (s)
 
27 dim a = 3: dim b =4 :dim c =5: dim d=6

s = a>b or not(c>d)

msgbox (s)
 
28 dim a = 3: dim b =4 :dim c =5: dim d=6

s = not(a>b) xor not(c>d)

msgbox (s)
 
29 dim a = 3: dim b =4 :dim c =5: dim d=6

s =  not(a>b) or not(c>d)

msgbox (s)
 
30  dim a = 3: dim b =4 :dim c =5: dim d=6

s =  a+c-b*d/2^2

msgbox (s)

沒有留言:

張貼留言