Welcome to Dream.In.Code
Become a VB Expert!

Join 149,480 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,471 people online right now. Registration is fast and FREE... Join Now!




Visual Basic Getting Started

 
Reply to this topicStart new topic

Visual Basic Getting Started

walkfacefirst
18 Apr, 2007 - 06:57 PM
Post #1

New D.I.C Head
*

Joined: 18 Apr, 2007
Posts: 1


My Contributions
Hi I was wondering if anyone can help me out of how to solve this problem. I need to have a program that calculates averages of student grades and also displays students grades. Im trying to figure out where to start but Im lost.

Thanks smile.gif
User is offlineProfile CardPM
+Quote Post

Nightshade
RE: Visual Basic Getting Started
19 Apr, 2007 - 08:00 AM
Post #2

New D.I.C Head
*

Joined: 22 Feb, 2007
Posts: 8


My Contributions
I'm afraid that it will need much more information.

Are you doing one student at a time? I.E you will puch in a bunch of grades and the program will average them. Following which you will record them elsewhere manually.
Do you need something that will track multiple students and allow you to go back to them at a later date?

Do you have any experience or are you aksing for someone to make the program for you?
User is offlineProfile CardPM
+Quote Post

THE_RAM
RE: Visual Basic Getting Started
21 Apr, 2007 - 01:14 PM
Post #3

New D.I.C Head
*

Joined: 29 Mar, 2007
Posts: 19


My Contributions
Your question is not quite clear,but from what i have made of it you need to consider the following:

The number of people you're going to be dealing with.
since it seems as if you will be dealing with a record of students, I suggest you use SELECT CASE instead of using multiple if statements.As for the coing, I can't help you because I don't know how far you are with it, and where you might be going wrong.Try including a piesce of your code next time. smile.gif
User is offlineProfile CardPM
+Quote Post

melonchollie540
RE: Visual Basic Getting Started
26 Apr, 2007 - 10:37 PM
Post #4

New D.I.C Head
*

Joined: 6 Feb, 2007
Posts: 29


My Contributions
Well yes more info would be useful, but you could just make an array and have each member of the array be assigned a different value through an input box that would stay up until a sentinel value is entered(If there is no definitive amount of input needed) or it could loop x amount of times and then the average can be calculated immediately following the input boxes looping.
User is offlineProfile CardPM
+Quote Post

EOgre0152
RE: Visual Basic Getting Started
1 May, 2007 - 07:12 AM
Post #5

New D.I.C Head
*

Joined: 27 Apr, 2007
Posts: 13


My Contributions
You might want to consider an alternative for this task. Creating a program to average grades is a bit overkill. I would suggest using excel to get your averages. You can then have a record of all the grades, the average appears wherever you set up the cell to calulate it. Sounds simpler to me at least.
User is offlineProfile CardPM
+Quote Post

Goddard
RE: Visual Basic Getting Started
1 May, 2007 - 11:49 AM
Post #6

New D.I.C Head
*

Joined: 23 Apr, 2007
Posts: 25


My Contributions
Well, I think I can give you an idea of where to start.

I made this GPA program. It takes the average of grades. It also keeps track of if the grade was male or female.(Not that the gender would help you in this program.)

Note: It will make an average of grades not just limited to GPA standards.

IPB Image

CODE
Public Class MainForm
    Dim GPA As Decimal
    Dim MaleTotal As Decimal
    Dim FemaleTotal As Decimal
    Dim Total As Decimal
    Dim TotalAvg As Decimal
    Dim MaleAvg As Decimal
    Dim FemaleAvg As Decimal
    Dim Male As Integer
    Dim Female As Integer

    Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
        'declare
        GPA = CDec(Val(Me.txtGPA.Text))

        If Me.radMale.Checked = True Then
            'Add GPA to Male Total
            MaleTotal = (MaleTotal + GPA)
            Total = (Total + GPA)
            Male = (Male + 1)
            'Calculate Averages
            TotalAvg = (Total / (Male + Female))
            MaleAvg = (MaleTotal / Male)
        Else
            If Me.radFemale.Checked = True Then
                'Add GPA to Female Total
                FemaleTotal = (FemaleTotal + GPA)
                Total = (Total + GPA)
                Female = (Female + 1)
                'Calculate Averages
                TotalAvg = (Total / (Male + Female))
                FemaleAvg = (FemaleTotal / Female)
            End If
        End If

        'Display GPA
        Me.lblTotalAverage.Text = TotalAvg.ToString
        Me.lblTotalMale.Text = MaleAvg.ToString
        Me.lblTotalFemale.Text = FemaleAvg.ToString
    End Sub

    Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
        Me.Close()
    End Sub

End Class


This might get you headed in the right track. rolleyes.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 04:14PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month