0

Hello!!!!
I am a novice programmer though, I am trying to code a vb 6.0 system that calculates total marks from the exams done and return the output. I only know the simplest way of addition, but I want the way to compute total by taking only the exams taken by a student, say the system has provided 12 options for the entry while the student took only 7 exams, and so the everage will be x/7. what of the student who takes 10 exams and using the same system to compute?

my simplest code is here:

Dim total, gpa As Integer
total = Int(Text19.Text) + Int(Text20.Text) + Int(Text21.Text) + Int(Text22.Text) + Int(Text23.Text) + Int(Text24.Text) + Int(Text25.Text)
Label24.Caption = total
gpa = total / 7
Label25.Caption = gpa

Thank you!!

4
Contributors
7
Replies
35
Views
6 Months
Discussion Span
Last Post by Minimalist
Featured Replies
  • 2
    ddanbe 2,525   6 Months Ago

    Do you still have to use vb6? What rproffit means that you have to make a variable call it `count` or something. Get it through a textbox or other input. Line 4 of your code should then read `gpa = total / count` Read More

0

First, VB6 is so old that it's something you need to avoid for any new system. As to the divisor you should chnage that to a variable that holds the number of exams.

0

Hello rproffitt

Please give me just an example , I will appreciate so much

2

Do you still have to use vb6?
What rproffit means that you have to make a variable call it count or something.
Get it through a textbox or other input.
Line 4 of your code should then read gpa = total / count

Edited by Reverend Jim: fixed extremely small typo (changed tecxtbox to textbox)

0

I get you, but I was restricted to use vb 6.0, however I am also using .net platform

0

That's confusing. I've worked in vb 6.0 and also .net but never found any crossover from vb6 to .net. How strange.

0

I am requesting you to assist me with a simple code for either vb 6.0 or .net please

Take the time to help us to help you. Please be thoughtful and detailed and be sure to adhere to our posting rules.