0% found this document useful (0 votes)
25 views

Visual Studio 2012

This Visual Studio program allows a user to input a whole number, calculates the sum of fractional terms from 1 to that number, and displays the result. It contains buttons to perform the calculation, clear the text boxes, and exit the application with a confirmation prompt.

Uploaded by

ricon900
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Visual Studio 2012

This Visual Studio program allows a user to input a whole number, calculates the sum of fractional terms from 1 to that number, and displays the result. It contains buttons to perform the calculation, clear the text boxes, and exit the application with a confirmation prompt.

Uploaded by

ricon900
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

VISUAL STUDIO 2012

Programacin
SUMA DE FRACCIONARIOS
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim x As Double
Dim m As Double
Dim n As Integer
n = TextBox1.Text
x=0
For i = 1 To n
m = i / (i + 1)
x=x+m
Next
TextBox2.Text = Format(Val(x), "##,##0.00000")

End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
TextBox1.Clear()
TextBox2.Clear()
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
If MsgBox("Desea salir de la aplicacion?", vbQuestion + vbYesNo, "salir") = vbYes
Then
End
End If
End Sub
End Class

You might also like