Miro 7
Miro 7
dy
Problem definition: illustrate the sequence of steps required for solving a
Problem is a situation that requires a solution or an objective problem or specific question.
you want to achieve through following consecutive steps Some advantages of Flowcharts:
sequentially. - Facilitating the reading and understanding of the problem
Problem solving:
ah
and illustrating to the programmer what must be done.
Problem Solving is the steps, activities, and processes to be
done to reach an output or objective. - Useful to explain the program to others
Problem solving: - helping in documenting the program in better manner,
especially if the program is complicated
Problem Solving is the steps, activities, and processes to be The most commonly used symbols as shown in the table:
m
done to reach an output or objective.
Problem solving stages: Significance Symbol
(1)Problem Definition
el
Identification of required outputs, available inputs and,
arithmetic and logical operations to be executed. Terminal
(2)Algorithm Preparation
Algorithm is one of the methods used to solve a problem
through logically arranged procedures (Flowchart). (input & output)
an
(3)Program Design
we have to translate this flowchart into one of the
programming language
(4)Program Testing (process)
We cannot detect errors unless we begin entering data to the
w
program with previously known results; and compare the
results of the current. (Decision)
(5) Documentation
ar
2
Prepared & Designed by/ﻳﺎﲰﲔ ﺷﻌﻴﺐ.ﺃ-ﺟﺮﻭﺏ ﻓﺮﻳﻖ ﺃﺻﺪﻗﺎء ﺍﻟﻜﻤﺒﻴﻮﺗﺮ
2022 - 2023
1- Properties such as (size-colour- font) of the text written on
the program interface.
dy
To construct a flowchart, we should consider the following: 2- Events such as click on a command button.
1. The flowchart should start with the Start symbol and end 3- Procedures, each one contains commands and instructions
with the End symbol. which are carried out when calling this procedure.
2. A,B,C are variable names .The variable refers to a memory So, the Visual Basic.net is considered:
ah
storage that holds a value. Object oriented as its programs work through objects in
3. Equation: C =A+B, indicates the sum of the value of A, to computer Memory.
the value of B, and stores the result in C. Event Driven as commands and instructions are carried out as
4. Entering values in A and B is done by using the term soon as certain event occurs.
“Enter”, inside The language of visual basic .net and framework.Net:
m
a parallelogram, like “Read” or The Framework.Net provides the following:
“Input”. * Libraries through which we create the objects.
5. The sum equation is written inside the rectangle, * Runtime environment (called Runtime) in computer memory
el
as it represents an arithmetic operation. where Applications produced by the language of Visual
6. The output is expressed with a parallelogram Basic.net language work in.
using the term “Output”, we can also use another term like * Compilers which compile commands and instructions
“Print” or "output". written in Programming language into machine code which
Note that flow line shows the order of an Algorithm. the Computer deals with.
an
Chapter Two: Introduction to Visual Basic.net Visual Basic .Net IDE:
The programmer of Visual Basic.net needs Integrated
The language of visual Basic .net: Development Environment (IDE) which provides tools and
It is one of the high level programming languages and merits to the programmer that help him create applications
designed to be easy to learn as its commands and instructions ( windows – mobile – web…..). Visual Studio represents IDE.
w
use English language vocabulary and it can be used in many Form:
applications such as: The form is the interface which the user deals with through
1- Windows applications different controls such as Button, Textbox, label……etc.
ar
2- Web applications Form window before putting controls Form window after
3- Mobile Application putting controls
Programming and computer memory:
Commands and instructions which are written in Visual Toolbox Window:
It contains tools of controls which can be put on the Form and
M
3
Prepared & Designed by/ﻳﺎﲰﲔ ﺷﻌﻴﺐ.ﺃ-ﺟﺮﻭﺏ ﻓﺮﻳﻖ ﺃﺻﺪﻗﺎء ﺍﻟﻜﻤﺒﻴﻮﺗﺮ
2022 - 2023
Some of these categories include: 10 WindowState
It defines the Window State of the Form
1. Common Controls (Maximizing, Minimizing or normal)
dy
2. Menus & Toolbars
3. Properties Window - There are common properties among different Controls such
Each tool of the above Common Controls has a group of as (Name-Text – Forecolor – Backcolor - Right To
properties which can be adjusted through "Properties Window" Left…….etc.)
- There are properties of the form, if they are set, they are
ah
as shown in this Figure:
Solution Explorer applied to Controls which are placed on this Form such as font
There is a list of folders and files of the projects in this part as and ForeColor properties
shown in this Figure: - When you set some properties, the effect of setting appears
directly on the Form in design mode of the program
Chapter Three: Controls
m
- There are some properties which their effect doesn't appear on
1. Form Controls until you set some other properties , for example the
The Form has many properties which share in defining the Right to Left Layout property doesn't work unless the value
Right to Left equals Yes
el
form of program screen we want to create. Here are some
properties of the Form: - The default value of the property (Text) and the property
N Property Name Function (Name) is the same and it is (Form1)
1 Name Name of Form used in Code Window
- There are some properties which their effect doesn't appear on
The appeared Text on the title bar of the the Form or Controls until you run the program
2 Text
an Window - The other Controls may have the same properties mentioned
3 Backcolor The background color of the Form. above, so they won't be repeated again when we studying these
The direction of Controls on the form other controls once more
4 Right to Left
Window From Right to Left. 2. Button
The layout of Controls on the Form from It is one of Controls which can be placed on the Form. When
w
5 Right to Left layout
right to left
It controls the appearance or you click it, it does a certain task.
6 MinimizeBox disappearance of MinimizeBox of Form Some distinctive properties of Command Button:
Window Property
ar
N Function
Name
It controls the appearance or
7 MaximizeBox disappearance of MaximizeBox of Form 1 Location The location of placing Button on the Form.
Window Defining the height and width of Button on the
2 Size
Form.
M
dy
Choosing the ForeColor to the appeared Text on
6 ForeColor
the Button 6. ComboBox
3. Label A ComboBox control displays a drop-down list from which
It is a tool used in showing a Text on the Form Window one item can be selected.
which can't be changed during program Runtime.
ah
Some distinctive properties of the Label: Some distinctive properties of the ComboBox:
N Property Name Function N Property Name Function
The Size of the Label is defined automatically 1
A group of items which are shown in
1 AutoSize according to the written Text if the Value of Items
comboBox.
m
property equals true.
2 BorderStyle Choosing the Border Style of the Label 2 It is a source of suggested items to
AutoCompleteSource
select from.
4. TextBox It defines the method of list
3 AutoCompleteMode
el
completing process.
It is a tool used to insert (input) data from the user during
program run time. 7. GroupBox
Some distinctive properties of the Textbox: Is used to group other controls of same function together on
N Property Name Function the Form window.
Maxlength
an It defines the maximum number of letters Text – Forecolor - RightToLeft
1
which can be inserted in the TextBox
PasswordChar It defines a symbol used instead of written 8. RadioButton
2
text in case we have a password. The program user selects one alternative only.
Multiline Allows multiple lines within the text box Some distinctive properties of the RadioButton:
3
w
control tool. N Property Name Function
5-ListBox It shows whether RadioButton has been
1 Checked
It shows a list of items. chosen or not.
ar
5
Prepared & Designed by/ﻳﺎﲰﲔ ﺷﻌﻴﺐ.ﺃ-ﺟﺮﻭﺏ ﻓﺮﻳﻖ ﺃﺻﺪﻗﺎء ﺍﻟﻜﻤﺒﻴﻮﺗﺮ
2022 - 2023
Chapter Four: Code Window (1)A drop-down menu of (Class Names) that displays the
names of controls on the form.
dy
Visual Basic.NET language provides a window through which (2)A drop-down menu of (Method Names) or events; associated
we can write instructions and codes of the program called with the item selected from the (Class Names) menu.
(code window) Event Handler
To open the (Code Window) of (Form1) perform the
ah
following:
1. Make sure that the window Form is active
2. From the keyboard press (F7)
The Code window is displayed as shown in the following
m
figure:
el
name).
(2) End of procedure line.
(3) ) What causes the call of the procedure (event
occurrence) .
an (4) Between the two lines shown; the code that will be
Code Window executed on calling the procedure is written after the
1. Name of the file where codes are saved occurrence of the (Event).
(5) The declaration of the class line (frmSquare).
2. Name of the file where the Form window interface is saved
(6) The end of (class) line.
3. The declaration of Class; its name is (Form1)
w
Setting the (Properties) programmatically
4. Space between two lines; to type codes for the Class (Form1) 1. In chapter 3, we have already set the properties through
5. The end of the class (form 1) properties window.
Event Handler
ar
In the (Solution Explorer) window, right click the file The control or the The
(Form1.vb) and, select (View Code) from the context menu as object name property The value
shown in this figure:
6
Prepared & Designed by/ﻳﺎﲰﲔ ﺷﻌﻴﺐ. ﺃ-ﺟﺮﻭﺏ ﻓﺮﻳﻖ ﺃﺻﺪﻗﺎء ﺍﻟﻜﻤﺒﻴﻮﺗﺮ
2022 - 2023
الحالة الثانية - :فى حالة السؤال عن خرائط التفرع الحالة االولى -:فى حالة السؤال عن
dy
درجات الحرارة -توقيت المواد الدراسية – مقارنة الحالة الثانية - :فى حالة السؤال عن (االكبر -االصغر -يساوى – ناجح – راسب-
من حيث االكبر االصغر متساويان أو نفس العمر زوجى -فردى مقارنة بين شخصين ) يتم استخدام
-1قسمة عددين ( العدد الثانى – المقسوم عليه – هذا الشكل من خرائط التدفق
صفرا -أطبع غير معروف ) R=N1/ N2
ah
Start أكبر من < -أصغرمن > -يساوى = -اكبرمن اويساوى
يتم كتابة الشرط N2=0داخل المعين =< -أصغرمن او يساوى => > < -اليساوى
m
Yes A=3.14*R*R Rسالبة Start
…Print
….. يتم كتابة الشرط R < 0داخل المعين
el
……Enter
No …
Start
…Print
….. ……Print ……Print
Yes
anNo .. ..
…Print
….. Yes خطوات الحل
End
w
……Print
-1بداية
End ..
-2ادخال ..........................
No
ar
-5نهاية
End
ﺟﺮﻭﺏ ﻓﺮﻳﻖ ﺃﺻﺪﻗﺎء ﺍﻟﻜﻤﺒﻴﻮﺗﺮ -ﺃ.ﻳﺎﲰﲔ ﺷﻌﻴﺐ Prepared & Designed by/
خرائط التكرار الحالة االولى -:فى حالة السؤال عن
dy
الحالة االثالثة -:فى حالة السؤال عن
M
Sum
J
الحالة االثانية -:فى حالة السؤال عن طباعة االعداد من ........الى .............
طباعة مجموع االعداد من ........الى .............
ah
طباعة حاصل ضرب االعداد أو
يجب التركيز على القيم التالية
جدول ضرب االعداد
-1قيمة البداية
Start
-2قيمة النهاية
Start -3مقدار الزيادة
m
N=……….
el
Sum=Sum+N J= 1 M =………….
N=N+…….. No
No
=<M
J<=12
an
No
Yes
N >…..
Yes J=J+1 Print M
Yes End
w
Print J*N ………M=M+
Print Sum
End
End -1قيمة البداية هى ............
-2قيمة النهاية هى ............
للحصول على قيمة Sum قيم Jهى ناتج ضرب االعداد من 1الى 12 -3مقدار الزيادة ..............
M
ﺟﺮﻭﺏ ﻓﺮﻳﻖ ﺃﺻﺪﻗﺎء ﺍﻟﻜﻤﺒﻴﻮﺗﺮ -ﺃ.ﻳﺎﲰﲔ ﺷﻌﻴﺐ Prepared & Designed by/