Top Banner

of 21

RD3802B36_Cap407__

Apr 09, 2018

Download

Documents

Ankur Singh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/7/2019 RD3802B36_Cap407__

    1/21

    SCIENTIFIC CALCULATOR

    Term Paper:-Scientific Calculator Course Code:- CAP 407

    Course Instructor: Mr. pankaj sharma

    Date of Allotment: Date Of Submission: 10/5/10

    Student Roll No. B36 Section: D3801

    Declaration: - I declare that this Term Paper is my individual work. I have not copied it from

    any other student work or from any other source except where due acknowledgement is made

    explicitly in the text, not as any part being written for me by another person.

    Arun

    Page1

  • 8/7/2019 RD3802B36_Cap407__

    2/21

  • 8/7/2019 RD3802B36_Cap407__

    3/21

    SCIENTIFIC CALCULATOR

    A scientific calculatoris a type of electronic calculator, usually but not always handheld,

    designed to calculate problems in science (especially physics), engineering, and mathematics.

    Page3

  • 8/7/2019 RD3802B36_Cap407__

    4/21

    In certain contexts such as higher education, scientific calculators have been superseded by

    graphing calculators, which offer a superset of scientific calculator functionality along with the

    ability to graph input data and write and store programs for the device. There is also some

    overlap with the financial calculator market.

    Functions:-

    Modern scientific calculators generally have many more features than a standard four or five-

    function calculator, and the feature set differs between manufacturers and models; however, the

    defining features of a scientific calculator include:

    Scientific notation for calculating large numbers

    Floating point arithmetic

    Logarithmic functions, using both base 10 and base e

    trigonometry functions

    exponents and roots beyond the square roots

    quick access to constants such as pi and e

    In addition, high-end scientific calculators include:

    hexadecimal, binary, and octal calculations, including basic Boolean math

    complex numbers

    fractions

    statistics and probability calculations

    programmability

    equation solving

    Page4

  • 8/7/2019 RD3802B36_Cap407__

    5/21

    While most scientific models have traditionally used a single-line display similar to traditional

    pocket calculators, many of them have at the very least many digits (10 to 12), sometimes with

    extra digits for the floating point exponent.

    A few have multi-line displays, with some recent models from Test

    instruments and Casio using Dot matrix displays similar to those found on graphing calculators.

    Uses:-

    1. Scientific calculators are used widely in any situation where quick access to certain

    mathematical functions is needed, especially those such as trigonometric functions that were

    once traditionally looked up in tables and some aspects of astronomy, physics, and chemistry.

    2. They are very often required for math classes from the junior high school level through

    college.

    3. These are generally either permitted or required on many standardized tests covering

    math and science subjects.

    Here is the snapshot of Scientific Calculator which I had made While I Started Making This

    Scientific Calculator:-

    Page5

  • 8/7/2019 RD3802B36_Cap407__

    6/21

    Introduction:-

    This is a scientific calculator involving many functions such as:

    1. Normal arithmetic operations.

    2. Functions such as factorial, permutation, combination etc.

    3. Scientific functions (sin, cos, sin-1

    , cos-1

    , etc.).4. Operations on complex numbers.

    5. Storage of values in variables and operations on these variables.

    6. Evaluation of simple series.

    7. Expressions involving any combination of the above.

    Page6

  • 8/7/2019 RD3802B36_Cap407__

    7/21

    Some Special Features

    1. Easy-to-use interface

    The calculator provides an easy-to-use interface. The expressions can be entered easily using the

    keyboard or by clicking the buttons using the mouse.

    2. Display of evaluated value in fraction form

    Values of expressions can be viewed in normal decimal form or in the fraction form. Default is

    the decimal form.

    3. Angle measurements

    We can do Angle measurements in degree, radian, or grade.

    4. Variables

    The calculator provides 9 memory variables.

    Values can be stored in these variables.

    The value can be that of real numbers or complex numbers.

    How to use:-

    1. Just open the scientific calculator

    1. Enter any expression.

    2. Press calculate button on the calculator.

    3. If the answer is lengthy scroll down the textbox to view the complete answer.

    This calculator will work like other calculators but there is something extra than the normal

    calculator. As it is scientific calculator so I had added the following functions to calculate or

    solve the complex mathematical expressions:-

    1. Sin function

    2. Cos function

    Page7

  • 8/7/2019 RD3802B36_Cap407__

    8/21

    3. Tan function

    4. Absolute function

    5. Square root function

    These functions will work accordingly to their inputs and will display the result when we press

    that particular function button or calculate button. Actually this project is under construction, so I

    havent mentioned and used all the functions there.

    CODING OF THE SCIENTIFIC CALCULATOR

    Page8

  • 8/7/2019 RD3802B36_Cap407__

    9/21

    Imports System.IO

    Imports System.Console

    Imports System.Math

    PublicClass Shivani

    Dim count1, f, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12 AsBoolean

    Dim a, b, c AsInteger

    'Dim exp1, exp2, result, mem As Double

    'Dim op As String

    Dim i, keyascii AsInteger

    Close Button Coding:-

    PrivateSub Button3_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button3.Click

    Dim drAs DialogResult

    dr = MessageBox.Show("Do You Really Want To Quit???", "exit",

    MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning)

    Ifdr = Windows.Forms.DialogResult.Yes = TrueThen

    Me.Close()

    EndIf

    EndSub

    Absolute Button Coding:-

    PrivateSub Button16_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button16.Click

    a = TextBox1.Text

    f4 = True

    b = Math.Abs(a)

    TextBox1.Text = b

    Page9

  • 8/7/2019 RD3802B36_Cap407__

    10/21

    EndSub

    Calculate Button Coding:-

    PrivateSub Button12_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button12.Click

    Iff = TrueThen

    TextBox1.Text += a

    ElseIff1 = TrueThen

    TextBox1.Text -= a

    ElseIff2 = TrueThen

    TextBox1.Text = a

    TextBox1.Text = b

    c = a / b

    ElseIff5 = TrueThen

    TextBox1.Text = b

    ElseIff6 = TrueThen

    TextBox1.Text = b

    ElseIff7 = FalseThen

    TextBox1.Text = b

    ElseIff8 = TrueThen

    TextBox1.Text = b

    ElseIff9 = TrueThen

    TextBox1.Text = b

    ElseIff10 = TrueThen

    TextBox1.Text = b

    ElseIff11 = TrueThen

    TextBox1.Text = b

    Page10

  • 8/7/2019 RD3802B36_Cap407__

    11/21

    Else : MessageBox.Show("Byee!!!", "Close")

    EndIf

    EndSub

    Backspace Button Coding:-

    PrivateSub Button22_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button22.Click

    'TextBox1.Text = ""

    Dim d AsNewInteger

    If(TextBox1.Text.Length > 0) Then

    EndIf

    d = TextBox1.Text.Length

    TextBox1.Text = TextBox1.Text.Remove(d - 1, 1)

    EndSub

    Buttons (0-10, +,-,/,*,etc.) Coding:-

    PrivateSub Button4_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button4.Click

    TextBox1.AppendText(Button4.Text)

    EndSub

    PrivateSub Button9_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button9.Click

    TextBox1.AppendText(Button9.Text)

    EndSub

    PrivateSub Button19_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button19.Click

    TextBox1.AppendText(Button19.Text)

    Page11

  • 8/7/2019 RD3802B36_Cap407__

    12/21

    EndSub

    PrivateSub Button2_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button2.Click

    TextBox1.AppendText(Button2.Text)

    EndSub

    PrivateSub Button8_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button8.Click

    TextBox1.AppendText(Button8.Text)

    EndSub

    PrivateSub Button20_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button20.Click

    TextBox1.AppendText(Button20.Text)

    EndSub

    PrivateSub Button1_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button1.Click

    TextBox1.AppendText(Button1.Text)

    EndSub

    PrivateSub Button7_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button7.Click

    TextBox1.AppendText(Button7.Text)

    EndSub

    Page12

  • 8/7/2019 RD3802B36_Cap407__

    13/21

    PrivateSub Button21_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button21.Click

    TextBox1.AppendText(Button21.Text)

    EndSub

    PrivateSub Button5_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button5.Click

    TextBox1.AppendText(Button5.Text)

    EndSub

    PrivateSub Button10_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button10.Click

    'TextBox1.Text = (Button10.Text)

    a = TextBox1.Text

    f1 = True

    TextBox1.Clear()

    EndSub

    PrivateSub Button18_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button18.Click

    TextBox1.Text = (Button18.Text)

    EndSub

    Multiply Button Coding:-

    PrivateSub Button6_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button6.Click

    a = TextBox1.Text

    Page13

  • 8/7/2019 RD3802B36_Cap407__

    14/21

    TextBox1.Text = Button6.Text

    'b = TextBox1.Text

    f7 = True

    TextBox1.Clear()

    b = a * b

    'TextBox1.Text = b

    EndSub

    PrivateSub Button11_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button11.Click

    'TextBox1.Text = (Button11.Text)

    a = TextBox1.Text

    b = TextBox1.Text

    f2 = True

    TextBox1.Clear()

    EndSub

    PrivateSub Button17_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button17.Click

    'TextBox1.Text = (Button17.Text)

    a = TextBox1.Text

    f = True

    TextBox1.Clear()

    EndSub

    Square Root Button Coding:-

    PrivateSub Button15_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button15.Click

    Page14

  • 8/7/2019 RD3802B36_Cap407__

    15/21

    a = TextBox1.Text

    f3 = True

    b = Math.Sqrt(a)

    TextBox1.Text = b

    EndSub

    PrivateSub Button23_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button23.Click

    TextBox1.AppendText(Button23.Text)

    EndSub

    Sin Function Button Coding:-

    PrivateSub Button14_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button14.Click

    a = TextBox1.Text

    f5 = True

    b = Math.Sin(a)

    TextBox1.Text = b

    EndSub

    Cos Button Coding:-

    PrivateSub Button13_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button13.Click

    a = TextBox1.Text

    f6 = True

    b = Math.Cos(a)

    TextBox1.Text = b

    Page15

  • 8/7/2019 RD3802B36_Cap407__

    16/21

    EndSub

    Off Button Coding:-

    PrivateSub Button27_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button27.Click

    IfButton27.Enabled = TrueThen

    'Me.Enabled = False

    TextBox1.Enabled = False

    Button1.Enabled = False

    Button2.Enabled = False

    Button3.Enabled = False

    Button4.Enabled = False

    Button5.Enabled = False

    Button6.Enabled = False

    Button7.Enabled = False

    Button8.Enabled = False

    Button9.Enabled = False

    Button10.Enabled = False

    Button11.Enabled = False

    Button12.Enabled = False

    Button13.Enabled = False

    Button14.Enabled = False

    Button15.Enabled = False

    Button16.Enabled = False

    Button17.Enabled = False

    Button18.Enabled = False

    Button19.Enabled = False

    Button20.Enabled = False

    Button21.Enabled = False

    Page16

  • 8/7/2019 RD3802B36_Cap407__

    17/21

    Button22.Enabled = False

    Button23.Enabled = False

    Button24.Enabled = False

    Button25.Enabled = False

    Button27.Enabled = False

    Button28.Enabled = False

    Button29.Enabled = False

    EndIf

    EndSub

    On Button Coding:-

    PrivateSub Button26_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button26.Click

    TextBox1.Enabled = True

    Button1.Enabled = True

    Button2.Enabled = True

    Button3.Enabled = True

    Button4.Enabled = True

    Button5.Enabled = True

    Button6.Enabled = True

    Button7.Enabled = True

    Button8.Enabled = True

    Button9.Enabled = True

    Button10.Enabled = True

    Button11.Enabled = True

    Button12.Enabled = True

    Button13.Enabled = True

    Button14.Enabled = True

    Button15.Enabled = True

    Button16.Enabled = True

    Page17

  • 8/7/2019 RD3802B36_Cap407__

    18/21

    Button17.Enabled = True

    Button18.Enabled = True

    Button19.Enabled = True

    Button20.Enabled = True

    Button21.Enabled = True

    Button22.Enabled = True

    Button23.Enabled = True

    Button24.Enabled = True

    Button25.Enabled = True

    Button27.Enabled = True

    Button28.Enabled = True

    Button29.Enabled = True

    EndSub

    PrivateSub Button28_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button28.Click

    TextBox1.Clear()

    EndSub

    Pie Function Button Coding:-

    PrivateSub Button29_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button29.Click

    a = TextBox1.Text

    f9 = True

    b = Math.PI

    TextBox1.Text = b

    EndSub

    Page18

  • 8/7/2019 RD3802B36_Cap407__

    19/21

    Logfunction Button Coding:-

    PrivateSub Button25_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)Handles Button25.Click

    a = TextBox1.Text

    f10 = True

    b = Math.Log(a)

    TextBox1.Text = b

    EndSub

    Tan function Button Coding:-

    PrivateSub Button24_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles Button24.Click

    a = TextBox1.Text

    f11 = True

    b = Math.Tan(a)

    TextBox1.Text = b

    EndSub

    EndClass

    OUTPUT OF THE CODING DONE:-

    Page19

  • 8/7/2019 RD3802B36_Cap407__

    20/21

    Page20

  • 8/7/2019 RD3802B36_Cap407__

    21/21