Ok di sini adalah apa yang saya punya, tapi aku tidak bisa mendapatkan perhitungan menambahkan kelas dan rata-rata di kotak bagian total.
Private Sub CalcBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalcBtn.Click
Dim NumStuTxtBx As Integer
Dim _NOS As Integer 'Number of Students'
Dim _NumOfClasses As Integer 'Number of additional classes'
Dim GrandTotal As Integer
Dim Grades As Double = 0
Dim Computed_Grades As Double = 0
Try
NumStuTxtBx = Integer.Parse(Me.NumStuTxtBx.Text)
_NOS += NumStuTxtBx
CalcBtn.Enabled = False
For a As Integer = 1 To NumStuTxtBx
Grades = CDbl(InputBox("Enter Grades of Students Exams"))
GrandTotal += Grades
Computed_Grades += Grades
AvgTxtBx.Text = CStr(Computed_Grades / _NOS)
AvgStuClsTxtBx.Text = CStr(GrandTotal / _NOS)
Next
NewClsBtn.Enabled = True
Catch ex As Exception
MsgBox("How Many Students are there in this Class?", MsgBoxStyle.OKOnly)
Me.NumStuTxtBx.Text = ""
Me.NumStuTxtBx.Focus()
Return
End Try
Me.NumStuTxtBx.Text = ""
Me.NumStuTxtBx.Focus()
AvgAllClsTxtBx.Text = CStr(GrandTotal / _NumOfClasses)
Return
End Sub
Private Sub NewClsBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewClsBtn.Click
Dim _NOS As Integer 'Number of Students'
Dim _NumOfClasses As Integer 'Number of additional classes'
Dim GrandTotal As Integer
CalcBtn.Enabled = True
NewClsBtn.Enabled = False
_NumOfClasses += 1
NumClsTxtBx.Text = CStr(_NumOfClasses)
AvgAllClsTxtBx.Text = CStr(GrandTotal + _NumOfClasses)
AvgStuClsTxtBx.Text = CStr(GrandTotal / _NOS)
NumStuTxtBx.Text = ""
NumStuTxtBx.Focus()
End Sub
Langganan:
Postingan (Atom)
Pengikut
Entri Populer
-
Metoda Pengurutan Quick Sort Dengan Bahasa C Roni akan membangun program yang akan melakukan proses pengurutan dengan metoda Quick Sort. ...
-
Pencarian Berurutan Adalah suatu teknik pencarian data dalam array (1 dimensi)yang akan menelusuri semua elemen-elemen array dari awal sa...
-
#include #include #include #define maks 5 using namespace std; class Queue{ friend ostream& operator
-
#include > #include #include using namespace std ; class node { friend class list; friend ostream& operator public: n...
-
Menghitung Rata-Rata untuk program Kelas: Private Sub CalcBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Calc...
-
6. class Stack { 7. friend ostream& operator<<(ostream&,const Stack&); 8. public: 9. Stack(); 10. ...
-
Operator Relasi # include # include main() { int a=20,b=20,sama1,tidaksama1,besar1,samabesar1,kecil1,samakecil1; float x=30.25,...
-
#include #include template using namespace std; class Kompleks { friend class operasi ; friend ostream& operator &); frie...