Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

QUADRATIC EQUATION ROOT FINDER CODE VB

The Code

Private Sub Form_Load()


Dim a, b, c, det As Integer
Dim root1, root2 As Single
Dim numroot As Integer
End Sub

Private Sub new_Click()


' To set all values to zero
Coeff_a.Text = ""
Coeff_b.Text = ""
Coeff_c.Text = ""
Answers.Caption = ""
txt_root1.Visible = False
txt_root2.Visible = False
txt_root1.Text = ""
txt_root2.Text = ""
Lbl_and.Visible = False
Lbl_numroot.Caption = ""
End Sub

Private Sub Solve_Click()


a = Val(Coeff_a.Text)
b = Val(Coeff_b.Text)
c = Val(Coeff_c.Text)

'To compute the value of the determinant

det = (b ^ 2) - (4 * a * c)
If det > 0 Then
Lbl_numroot.Caption = 2
root1 = (-b + Sqr(det)) / (2 * a)
root2 = (-b - Sqr(det)) / (2 * a)
Answers.Caption = "The roots are "
Lbl_and.Visible = True
txt_root1.Visible = True
txt_root2.Visible = True
txt_root1.Text = Round(root1, 4)
txt_root2.Text = Round(root2, 4)

ElseIf det = 0 Then


root1 = (-b) / 2 * a
Lbl_numroot.Caption = 1
Answers.Caption = "The root is "
txt_root1.Visible = True
txt_root1.Text = root1
Else
Lbl_numroot.Caption = 0
Answers.Caption = "There is no root "
End If
End Sub

CALCULATOR CODE:

Sub CheckValue( )

displayValue = Val(panel.Caption)

End Sub

'The code for the operators is as follow:

Private Sub Operator_Click(Index As Integer)


CheckValue
If Index = 11 Then
a = displayValue
key = 1

ElseIf Index = 12 Then


b = displayValue
key = 2

ElseIf Index = 13 Then


c = displayValue
key = 3

ElseIf Index = 14 Then


d = displayValue
key = 4

ElseIf Index = 15 Then


f = displayValue
key = 5

End If

Num_of_digit = 0
newNumber = True

End Sub

'The code for the Equal button is as follow:

Private Sub Equal_Click()

CheckValue
If newNumber = True Then
If key = 1 Then
e = displayValue + a
ElseIf key = 2 Then
e = b - displayValue

ElseIf key = 3 Then


e = displayValue * c

ElseIf key = 5 Then


e = (f * displayValue) / 100

ElseIf key = 4 And displayValue <> 0 Then


e = d / displayValue

Else

GoTo error

End If
If Abs(e) < 1 Then
panel.Caption = Format(e, "General Number")
Else

panel.Caption = Str(e)
End If
Else
panel.Caption = displayValue

End If

GoTo finish

error: panel.Caption = "E"


finish:

Num_of_digit = 0
newNumber = False

End Sub

Blue crane =

Best Slogans on Education to Promote Literacy

Education is power.
Education Brings Prosperity.
By nature, all people are alike, but by education become different.
If someone is going down the wrong road, he doesnt need motivation to speed him up. What he
needs is education to turn him around.
Education is a human right with immense power to transform. On its foundation rest the
cornerstones of freedom, democracy and sustainable human development.
You educate a man; you educate a man. You educate a woman; you educate a generation.
The foundation of every state is the education of its youth.
Education: the path from cocky ignorance to miserable uncertainty.
Marriage can wait, education cannot.
Education is a better safeguard of liberty than a standing army.
Education is not filling a bucket, but lighting a fire.
Education is our passport to the future, for tomorrow belongs to the people who prepare for it
today.
Education is the most powerful weapon, that can change the world.
Educations purpose is to replace an empty mind with an open one.
Education is the key to unlock the golden door of freedom.
Education is simply the soul of a society as it passes from one generation to another.
Education Your Door To The Future.
The educated differ from the uneducated as much as the living differs from the dead.
If you think education is expensive, try ignorance.
Education is learning what you didnt even know you didnt know.
Children are the future, Educate them well and let them lead the way.
Each one teaches one.
Education cant make us all leaders, but it can teach us which leader to follow.
Learning Today . . . Leading Tomorrow.
The highest education is that which does not merely give us information but makes our life in
harmony with all existence.
Education is what remains after one has forgotten everything he learned in school.
Education is only a ladder to gather fruit from the tree of knowledge, not the fruit itself.
Wisdom. comes not from age, but from education and learning.
Education is the power to think clearly, the power to act well in the worlds work, and the power
to appreciate life.
Education is not a product: mark, diploma, job, money in that order; it is a process, a never-
ending one.
Education makes a people easy to lead, but difficult to drive; easy to govern but impossible to
enslave.
An education isnt how much you have committed to memory, or even how much you know. Its
being able to differentiate between what you know and what you dont.
Education is a vaccine for violence.
Education is the kindling of a flame, not the filling of a vessel.
Education is an ornament in prosperity and a refuge in adversity.
Sixty years ago I knew everything; now I know nothing; education is a progressive discovery of
our own ignorance.
Education is the transmission of civilization.
Education is education. We should learn everything and then choose which path to follow.
Education is neither Eastern nor Western, it is human.
Education doesnt change life much. It just lifts trouble to a higher plane of regard.
Education can and should do much influence social, moral and intellectual discovery by
stimulating critical attitudes of thought in the young.
Education is not just going through some structured systems and getting degrees. It is more
about the beautification of the heart and the world.
The entire object of true education, is to make people not merely do the right thing, but to enjoy
right things; not merely industrious, but to love industry; not merely learned, but to love
knowledge.
Education must provide the opportunities for self-fulfillment; it can at best provide a rich and
challenging environment for the individual to explore, in his own way.
Education is the power to think clearly, the power to act well in the worlds work, and the power
to appreciate life.
Education is a kind of continuing dialogue, and a dialogue assumes different points of view.

You might also like