i need comments on the code example: int x; // declare x
and life cycle
VB Code
Imports SystemImports System.Collections.GenericImports System.ComponentModelImports System.DataImports System.DrawingImports System.LinqImports System.TextImports System.Threading.TasksImports System.Windows.Forms
Namespace StudentPublic Partial Class Form1Inherits Form
Public Sub New()InitializeComponent()End Sub
Private Sub btnCalculatePerc_Click(ByVal sender As Object, ByVal e As EventArgs)txtPercentage.Text = ((Convert.ToInt32(txtMark1.Text) + Convert.ToInt32(txtMark2.Text) + Convert.ToInt32(txtMark3.Text)) / 3).ToString()End Sub
Private Sub btnDisplayGrade_Click(ByVal sender As Object, ByVal e As EventArgs)If Convert.ToDouble(txtPercentage.Text) >= 80 ThentxtLevel.Text = "Excellent"ElseIf Convert.ToDouble(txtPercentage.Text) >= 70 AndAlso Convert.ToDouble(txtPercentage.Text) <= 79="">=>txtLevel.Text = "Very Good"ElseIf Convert.ToDouble(txtPercentage.Text) >= 60 AndAlso Convert.ToDouble(txtPercentage.Text) <= 69="">=>txtLevel.Text = "Good"ElseIf Convert.ToDouble(txtPercentage.Text) >= 50 AndAlso Convert.ToDouble(txtPercentage.Text) <= 59="">=>txtLevel.Text = "Satisfactory"ElseIf Convert.ToDouble(txtPercentage.Text) < 50="">txtLevel.Text = "Fail"End IfEnd SubEnd ClassEnd Namespace
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here