computer revision
computer revision
Computer Revision
Third Prep
First Term
2020 / 2021
Name : ………………………………
Class : ………………
Chapter 1 : problem solving
Name Definition
Page [1]
Geometric symbols used in flowchart
Flowchart :
1- The flowchart should start with the Start symbol and end with the End
symbol.
2- A,B,C are variable names .The variable refers to a memory storage that holds a
value.
3-The equation: C =A+B, indicates the sum of the value of A, to the value of B, and
stores the result in C.
4-Entering values in A and B is done by using the term “Enter”, inside a
parallelogram, you can also use another term to get the same meaning
like “Read” or “Input”.
Page [3]
3-Write down the Algorithm, and draw aflowchart to compute area and the perimeter of a
rectangle whose length (L) and width (W) are known, bearing in mind that the equation of the
area is : Area=L*W and that of the perimeter is : perimeter =2(L*W)
Second :Algorithm Third :Flowchart
1. start
2. enter value of R
3. processing Area=L*W
perimeter=2(L*W)
4. output Area -Perimeter
5. end
4-Write down the Algorithm, and draw a flowchart to calculate the area of a circle whose radius
“R” is known , bearing in mind that the equation of the area of circle is : Area=3.14*R*R.
Algorithm Flowchart
1. start
2. enter value of R
3. processing Area=3.14*R*R
4. print result Area
5. end
5- Write down the Algorithm, and draw a flowchart to calculate the number of years,
bearing in mind that the number of months is known.
Algorithm flowchart
1. start
2. enter value of Y
3. processing Y=M/12
4. print result Y
5. end
Page [4]
2 Branching Flowcharts
5-Draw the flowchart to print the word “successful” in the case of the degree input is greater
than or equal to 50.
6: Draw the flowchart for a program that will calculate the division of two numbers. If the
divisor equals (zero), the message displays “undefined”.
Page [5]
7: Draw aflowchart for aprogram that obtains anumber from the user. Determine the number
type (even or odd)
8: Draw the flowchart to get a temperature degree , and print out the following results “greater
than zero “ – “less than zero” or “equal zero “
Page [6]
9: Write down the algorithm, and draw aflowchart to center two unequal numbers, then print
the largest is….? And the smallest number is ….?
10: The following flowchart is used to calculate the Area of a circle with radius “R”. Redraw the
flowchart so that it displays the message “not allowed” and exist from the program (when the
value of “R” is negative).
Page [7]
3 Looping Flowcharts
11: Print out the numbers from 1 to 3
First: Define the problem
Output: print numbers from 1 to 3
Input: number M
Solution: print number M and increment it by 1 then continue printing until the value of
M become greater than 3
Page [8]
13-Print the multiplication table of entered number J
Algorithm flowchart
1- start
2-
3- enter N
4- J=1
if J<=12 then
4-1- print J*N
4-2- J=J+1
4-3- go to step 4
5- end
3 -if
M<=10 then
3-1- print M
3-2- M=M+2
3-3- go to step 3
4 - end
Page [9]
15- print out the sum of integer numbers from 1 to 3
Page [10]
16- print out the sum of odd numbers from 1 to 10.
Algorithm flowchart
1- start
2- N=1
3-sum=0
4-sum=sum+N
5- N=N+2
6- if N>10 then
6-1- print sum
7-Else
7-1- go to step 4
8-end
Page [11]
Chapter 2
Introduction to Visual Basic.net
In this chapter, you will deal with Visual Basic.net program which will enable you to
convert the steps of solving a problem into programme codes that can be carried out.
It is one of the high level programming languages and
designed to be easy to learn as its commands and instructions
Language of use English language vocabulary and it can be used in many
visual basic applications such as:
1- Windows applications
2- Web applications
Commands and instructions which are written in Visual
Basic.net enable you to create objects in computer memory and
every object has:
1- Properties such as (size-color- font) of the text written on the
program interface.
Programming 2- Events such as click on a command button.
and computer 3- Procedures, each one contains commands and instructions
memory which are carried out when calling this procedure.
So, the Visual Basic.net is considered:
Object oriented as its programs work through objects in
computer Memory.
Event Driven as commands and instructions are carried out as
soon as certain event
The Framework.Net provides the following:
* Libraries through which we create the objects,
* Runtime environment (called Runtime) in computer memory
Framework .net where Applications produced by the language of Visual
Basic.net language work in.
* Compilers which compile commands and instructions written
in Programming language into machine code which the
Computer deals with.
The programmer of Visual Basic.net needs Integrated
Development Environment ( IDE ) which provides tools and
Visual basic.net merits to the programmer that help him create applications (
and IDE windows – mobile – web…..).
Page [12]
The form is the interface which the user deals with through
different controls such as( Button, Textbox, label……)etc.
Form
Toolbox
Page [13]
Each tool of the above Common Controls has a group of
properties which can be adjusted through "Properties Window"
Properties
window
Solution explore
Page [14]
Chapter 3
Form properties The form is the interface which the user deals with through
different controls such as( Button, Textbox, label……)etc.
Page [15]
Button
It is one of Controls which can be placed on the Form. When you click it, it does a certain
task. Placing the Button on the form.
By double clicking on the Button control on Toolbox, the Button appears on the Form in
Design mode
Note that when you click on the command button in the design
mode:
Label It is a tool used in showing a Text on the Form Window which can't be changed
during program Runtime.
Some distinctive properties of the Label
Notice: You can change the size of Label manually by using the process of drag and drop
when the Value of the property AutoSize is false through the eight handles in design mode
only and its effect appears in design mode and runtime mode.
Page [16]
TextBox
It is a tool used to insert (input) data from the user during program in run time.
Some distinctive properties of the Textbox:
Page [17]
ComboBox
A ComboBox control displays a drop-down list from which one item can be selected.
Some distinctive properties of the ComboBox:
GroupBox
Is used to group other controls of same function together on the Form window
Here is the effect of setting some properties on the GroupBox
Checkbox
It is used for placing some alternatives to enable the user to select one CheckBox or more
During program runtime.
Page [18]
Code Window
Visual Basic.NET language provides a window through which we can write instructions and
codes of the program called (code window)
To open the (Code Window) of (Form1) perform the following:
1. Make sure that the window Form is active
2. From the keyboard press (F7)
The Code window is displayed as shown
Event Handler
It’s a procedure which contains a code that is carried out when a corresponding event
occurs..
To create event handler do the following steps:
1. In the (Solution Explorer) window, right click the file (Form1.vb) and, select (View
Code) from the context menu
When choosing (View Code) the following figure appears
Page [19]
5
4
1
2 3
6
The numbers shown in figure indicate:
(1) The procedure name composed of (object name, event name).
(2) End of procedure line.
(3) What causes the call of the procedure (event occurrence) .
(4) Between the two lines shown; the code that will be executed on calling the procedure is
written after the occurrence of the (Event
(5) The declara on of the class line (frmSquare)
(6) The end of (class) line.
Setting the (Properties) programmatically.
In chapter 3, we have already set the properties through properties window. You can adjust
the properties using the following syntax:
Example:
Write the following code in the appropriate event handler (Button1_Click) for button1
Questions answers
Chapter (1,2,3)
Page [21]
Computer and information technology Third grade preparatory First semester 2020/2021
Second: Choose the appropriate answer to complete each phrase of the following:
1- Steps, activities and procedures to be done to reach an objective or an output - can be called:
a. problem definition b. problem c. problem solving
2- On drawing flowcharts we use:
a. standard symbols and lines b. all geometric figures c. one geometric figure
3- A set of procedures arranged logically for solving a specific problem –can be called:
a. problem b. algorithm c. program testing
4- Making sure that the program is free of errors –can be called:
a. program testing b. program documentation c. algorithm
5- Writing down all the steps taken to solve a problem errors–can be called:
a. program documentation b. program testing c. flowcharts
Problem-solving approach includes many terminologies, the terminology that expresses the
preparation of a cup juice is:
a. Flowchart b. algorithm c. problem
7- Problem-solving approach includes many of the terminologies, the terminology that expresses
the mathematical problem is:
a. Algorithm b. problem c. program design
Page [22]
Computer and information technology Third grade preparatory First semester 2020/2021
8- A schematic representation that depends on drawing some standard symbols to clarify the
order of procedures to solve a problem can be called:
a. Problem b. algorithm c. flowchart
9- In the following flowchart: The number of iterations (print the value of M) is:
a- 2 b- 3 c- 4
10In Flowchart of the previous question, the value of M after the end of the iterativeloop equals:
a. 2 b- 3 c- 4
2. /ƐĂƐŝƚƵĂƚŝŽŶƚŚĂƚƌĞƋƵŝƌĞƐĂƐŽůƵƚŝŽŶŽƌĂŶŽďũĞĐƚŝǀĞLJŽƵǁĂŶƚƚŽĂĐŚŝĞǀĞ WƌŽďůĞŵ
5. Writing down all the steps taken to solve a problem error Documentation
Page [24]
Computer and information technology Third grade preparatory First semester 2020\2021
Page [25]
Questions Chapter 3
First: Put ( √ ) in front of the correct sentence and (X) in front of the wrong one:
1 The function of the property RightToLeft of the Form is to define the direction of ) √(
Controls from right to left.
2 The function of the property RightToLeft of the Form is to define the state of the ) ×(
Form on the screen in a position of Maximizing or Minimizing.
3 Setting the property ControlBox of the Form can control the Form in a position of ) ×(
Maximizing during programme.runtime.
4 The property “Name" is used in showing a certain Text in the title bar of user window )×(
a name of the window.
5 The property Text is used in showing a certain text the title bar of of user window. )√(
6 Setting some properties of the Form is applied to Controls which are placed on the )√ (
Form.
7 The effect of setting the Window State property of the form appears only in runtime )√(
mode
8 You can change the location of Command Button on the Form through Size property. ) ×(
9 You can change the location of Command Button on the Form through Location ) √(
property.
10 Placing Controls automatically on the Form on the co-ordinate (0-0) is in the middle ) ×(
of the Form.
11 You can change the size of Label manually if Auto Size=true ) ×(
12 You can change the size of Label manually if Auto Size=false )√ (
13 "Textbox control tool: is the only tool which has the property Auto Size ) ×(
14 ListBox and ComboBox share in "Item " property. ) √(
15 ListBox and andComboBox share in " Suggest " property ) ×(
16 GroupBox is the tool used in contain a group of controls, these controls have the same ) √(
function on the Form.
17 ListBox is the tool used in contain a group of controls, these controls have the same ) ×(
function on the Form.
18 CheckBox can be used on the Form to choose the Gender of student male or female. ) ×(
19 Combobox is the control tool that allows the user to choose one element of several ) √(
elements in the smallest possible space on the form window
Page [26]
Second: Choose the correct answer to complete each statement:-
1- The function of "Right to Left" property of the Form is:
a- define the direction of Control tools from Right to Left.
b- define whether the layout of ControlTools on the Form is from Right to Left.
c-define the state of the window in a state of maximaizing or minimaizing.
2- ControlBox property of the Form is helping to:
a- showing or hiding of Maximizing Box.
b- control the appearance of the Form whether it is in a position of Minimaizing / Maximaizing / Normal.
c-Control the appearance or disappearance of ControlBox in the Form.
3-The used property in showing a certain Text on the titlebar of a Form is :
a- Name b-Text c-FormBorderStyle
4-On setting some properties of the Form, they are applied on Control Tools
Which are placed on the Form (one of them is):
a-Name b-Forecolor c-Text
5-The effect of setting this property doesn't appear unless in runtime mode (This property is):
a-FormBorderStyle b-WindowState c-RightToLeft
6-The property which is responsible for the size, shape and effect of the Text font shown on the Button is
a-Backcolor b-Forecolor c-Font
7-You can change the position of the Button on the Form through the following processes except for :
a-drag and drop by the mouse
b-setting Size property
c-setting Location property
8-You can change the position of the Button on the Form through :
a. Setting Location property
b-setting Size property
c-the eight squares around the Button
9-On inserting any Control Tool by pressing D-Click from the Toolbox on the Form , the appropriate
place to be shown is :
a-coordinate (0,0)
b-the middle of the Form
c-the position of Control Tool is different according to the size of the Form
10-The size of Label is defined automatically on the Form if the property is:
a-Auto Size = False b- Border Style= Fixed Single c- Auto Size=True.
11-You can change the size of control "Label" manually if the property is :
a- Auto Size = False- b- Border Style= Fixed Single c- Auto Size=True-
Page [27]
12-The following properties belong to TextBox except for:
a-AutoSize b-MultiLine c-MaxLength
13-The Object TextBox is marked by one property :
a-AutoSize b-Name c-PasswordChart
14-The right value which can be used to set the PasswordChart of the TextBoxis :
a-Pw b-True c-*
15-The ListBox and ComboBox share in this property :
a-Suggest b-Item c-SelectionMode
16-The ControlTool which is used in containing a group of controls that have the same function on the Form is:
a-ComboBox b-ListBox c-GroupBox
17-The Control tool which can be used on the Form to choose Gender of the student "male"or "female" is:
a-RadioButton b-CheckBox c-TextBox
18-The ControlTool which can be used on the Form and allows the user to choose more than one
alternatives is :
a-RadioButton b-GroupBox c-CheckBox
19-The ControlTool which allows the user to choose one item of 15
in the smallest possible area on the Form is:
a-ComboBox b-ListBox c-RadioBox
Page [28]
Chapter 4 code window
Quations :
1) Complete the table with a number from 1 to 5 using the next screen to express every number to
what it refers to:
NO. Indicate
(…5.) The end of class
(…4.) The place to write the codes of the class
(2….) The name of the file that saves the design
of the form interface
(…1.) The name of the file that saves the code
(3….) The start of the class
Page [29]
4) Complete the table using the following screen :
NO. Indicates
A drop-down menu of (Class Names) that displays the
1
names of controls on the form
2 Form Name (frmsquare)
A drop-down menu of (Method Names) or events; associated
3
with the item selected from the (Class Names) menu.
a- From the previous screen write 3 different events :…click…… …double click… …AutoSizeChanged……
b- frmSquare refers to ……class name…….
c- The events in the window belong to the control ………Button1………..
d- The name of the active tab in the window is …frmsquare.Vb…
Page [30]
6) Complete the table using the following screen :
indicatesNO.
NO. Indicates
1 The procedure name composed of (object name, event name).
2 End of procedure line.
3 What causes the call of the procedure (event occurrence) .
Between the two lines shown; the code that will be executed on
4
calling the procedure is written after the occurrence of the (Event
5 The declaration of the class line (frmSquare)
6 The end of (class) line.
…
7) Explain the components of the general syntax to adjust the properties of controls programmatically:
ControlName.Property = Value
The control or the … The property….. …… The value………
object name…….
8) Explain the following codes through your pervious study for the general syntax to adjust the
properties of control programmatically :
(A) Button2.Text = "END"
………write text END on the face of tool………….
(B) Label1.AutoSize = True
……Change size of Label1 automatically depend on text written inside………….
Page [31]
Page [32]