Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Your Glorious Instructor has assigned you the task of creating an application fo

ID: 665629 • Letter: Y

Question

Your Glorious Instructor has assigned you the task of creating an application for testing Complex Numbers. If you've not had Calculus III, a complex number is a pair of real numbers (a,b) upon which we define addition and multiplication in the following fashion for two complex numbers c and d:

You use Visual Studio to create a form for your test application that looks like this:

Assume that for the complex number X, the text box for the real portion of the number is named reXTextBox and the text box for the imaginary portion is named imgXTextBox. For the complex number Y, the text boxes are named reYTextBox and imgYTextBox. The two buttons are named addButton and multiplyButton. Write the c# code behind for event handlers for each button. Put the result back into the text boxes for the complex number X.

Explanation / Answer

Code For Addition and Multiply of complex no

Public Class ComplexNumber
    Public realNo As Integer
    Public imag As Integer

Public Function calctn(C1 As COmplexNumber, C2 As COmplexNumber,ByVal optr as string) As COmplexNumber
        Dim result As New COmplexNumber
        if (optr ="+") then
        result.realNo = (C1.realNo + C2.realNo)
            result.imag = (C1.imag + C2.imag)

    else if (optr ="*") then
        result.realNo = (C1.realNo * C2.realNo)
            result.imag = (C1.imag * C2.imag)


    end if
        calctn = result
    End Function
End Class

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote