مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1-...

34
ة ج م ر لب ا ي ف ة م د ق مLecture 7

description

Create an Interface, Change properties:

Transcript of مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1-...

Page 1: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

البرمجة في مقدمة

Lecture 7

Page 2: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Write VB.net project using the for loop to calculate:

1 -the sum of numbers from 1 to (A) numbers.

2 -the sum of Odd numbers from 1 to (A) numbers.

3 -the sum of Even numbers from 1 to (A) numbers.

) **A : any number input by user.(

Page 3: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Create an Interface , Change properties:

Page 4: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Write a code :

Double click on : 1 -Button 1:

Dim i, a, x as integer a = Val(textbox1.text)x=0For i =1 to ax= x + iNext iTextbox2.text = x

Page 5: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Write a code :

Double click on : 2 -Button 2:

Dim i, a, x as integer a = Val(textbox1.text)x=0For i =1 to a step 2x= x + iNext iTextbox3.text = x

Page 6: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Write a code :

Double click on : 3 -Button 3:

Dim i, a, x as integer a = Val(textbox1.text)x=0For i =0 to a step 2x= x + iNext iTextbox4.text = x

Page 7: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Write a code :

Double click on : 4 -Button 4:

Textbox1.text“ “ = Textbox2.text“ “ = Textbox3.text“ “ = Textbox4.text“ “ =

Page 8: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Execute a program: -Input a number :

Page 9: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Execute a program: -When we Click on The sum of numbers button,

the result will appear:

Page 10: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Execute a program: -When we Click on The sum of odd numbers

button, the result will appear:

Page 11: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Execute a program: -When we Click on The sum of even numbers

button, the result will appear:

Page 12: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Execute a program: -When we Click on Delete button, all textboxes

will be clean:

Page 13: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Write VB.net project using the Do / While loop to calculate:

1 -the sum of numbers from 1 to (A) numbers.

2 -the sum of Odd numbers from 1 to (A) numbers.

3 -the sum of Even numbers from 1 to (A) numbers.

) **A : any number input by user.(

Page 14: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Create an Interface , Change properties:

Page 15: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Write a code :

Double click on : 1 -Button 1:

Dim i, a, x as integer a = Val(textbox1.text)x=0i = 1Do while i <= ax= x + ii = i +1loopTextbox2.text = x

Page 16: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Write a code :

Double click on : 2 -Button 2:

Dim i, a, x as integer a = Val(textbox1.text)x=0i = 1Do while i <= ax= x + ii = i +2loopTextbox3.text = x

Page 17: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Write a code :

Double click on : 3 -Button 3:

Dim i, a, x as integer a = Val(textbox1.text)x = 0i = 0Do while i <= ax= x + ii = i +2loopTextbox4.text = x

Page 18: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Write a code :

Double click on : 4 -Button 4:

Textbox1.text“ “ = Textbox2.text“ “ = Textbox3.text“ “ = Textbox4.text“ “ =

Page 19: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Execute a program: -Input a number :

Page 20: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Execute a program: -When we Click on The sum of numbers button,

the result will appear:

Page 21: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Execute a program: -When we Click on The sum of odd numbers

button, the result will appear:

Page 22: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Execute a program: -When we Click on The sum of even numbers

button, the result will appear:

Page 23: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Execute a program: -When we Click on Delete button, all textboxes

will be clean:

Page 24: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Write VB.net project using the Do Until Loop to calculate:

1 -the sum of numbers from 1 to (A) numbers.

2 -the sum of Odd numbers from 1 to (A) numbers.

3 -the sum of Even numbers from 1 to (A) numbers.

) **A : any number input by user.(

Page 25: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Create an Interface , Change properties:

Page 26: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Write a code :

Double click on : 1 -Button 1:

Dim i, a, x as integer a = Val(textbox1.text)x=0i = 1Do Until i > ax= x + ii = i +1loopTextbox2.text = x

Page 27: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Write a code :

Double click on : 2 -Button 2:

Dim i, a, x as integer a = Val(textbox1.text)x=0i = 1Do Until i > ax= x + ii = i +2loopTextbox3.text = x

Page 28: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Write a code :

Double click on : 3 -Button 3:

Dim i, a, x as integer a = Val(textbox1.text)x=0i = 0Do Until i > ax= x + ii = i +2loopTextbox4.text = x

Page 29: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Write a code :

Double click on : 4 -Button 4:

Textbox1.text“ “ = Textbox2.text“ “ = Textbox3.text“ “ = Textbox4.text“ “ =

Page 30: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Execute a program: -Input a number :

Page 31: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Execute a program: -When we Click on The sum of numbers button,

the result will appear:

Page 32: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Execute a program: -When we Click on The sum of odd numbers

button, the result will appear:

Page 33: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Execute a program: -When we Click on The sum of even numbers

button, the result will appear:

Page 34: مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.

Execute a program: -When we Click on Delete button, all textboxes

will be clean: