VS 2010 Storing Grades Into An Array & Output Average / Letter Grade

May 13, 2011

"I need to create a program that will allow the user to enter in 10 test grades from a class. I need to store these grades into an array, and use a loop to add up the total. Then I'll need to output the average, and the letter grade for the average using:

90 - 100 A
80 - 89 B
70 - 79 C
60 - 69 D

Below 60 F"

That's all it needs to do. Here is some code that shows you that the only thing I know how to do is (allow the user to enter in 10 test grades from a class.) The rest I'm so lost on and have a crappy instructor. This assignment is due tomorrow, but the instructor is not available over the weekend.

Here is my This is all I have:

Dim MyNumbers(9) As Integer
Dim Total As Integer
Dim i As Integer

[Code]....

View 9 Replies


ADVERTISEMENT

Averaging 15 User-input Grades And Then Telling The Letter Grade

Jun 5, 2011

It is meant to average 15 user-input grades and then from there I have to provide the letter grade that corresponds with the average percent. I understand how to provide the corresponding letter grade, but I don't understand how to get the average. I've tried putting it into arraylist format

View 4 Replies

Course Average To Letter Grade?

Mar 3, 2010

It works up to this point but when I try to add so that 70-79 is a C, 60-69 is a D, and 60 and less is a F I run in to problems.

Module Module1
Dim Average As Integer = 0
Dim Response As String = ""

[code].....

View 3 Replies

Takes 3 Percentages(numbers) And Returns An Average Of The Grades In Letter Format(A,B,C)?

Apr 15, 2011

I'm new to coding and i need to make a program that takes 3 percentages(numbers) and returns an average of the grades in letter format(A,B,C). This is what I have so far:[code]......

View 2 Replies

Declare Variables For The Average Score And The Letter Grade?

Apr 18, 2011

I am taking an online class and I am having trouble getting my solution to work. My assignment is as follows: In the function, declare variables for the average score and the letter grade. Calculate the average, use If/ElseIf statements to determine the letter grade, and return the letter grade.

Create a subprocedure for the Click event for the btnDisplay button. It should call the CalculateGrade function with three arguments (the three test scores from the text boxes), and display the returned value in the lblGrade box.I have looked all over the internet and have had no luck finding an example to look at I am taking an online class and I am having trouble getting my solution to work. My assignment is as follows:

In the function, declare variables for the average score and the letter grade. Calculate the average, use If/ElseIf statements to determine the letter grade, and return the letter grade.

[Code]...

View 7 Replies

Array Calculating Min, Max, And Average Output: Min, Max, And Average?

Mar 26, 2012

I put comments on the average output since I kept getting error messages about that. My out keeps saying:

Maximum value: 33
Minimum value: 33
what am I doing wrong?
Option Explicit On
Option Strict On

[Code]...

View 2 Replies

Write A Program Using 2 Parallel Arrays Representing Grade Point And Grades?

Jan 31, 2010

I have to write a program using 2 parallel arrays representing grade point and grades. The grade points range from 0 to 500, however, we are only to use the minimum points per each letter grade in " points " array. This is shown in the code below. You then enter a number from 1 to 500, representing the grade points, and in turn it spits out your letter grade.My problem is this. When I enter a number, say 200, I get a letter " D " grade instead of an " F " grade. It appears that every number range I enter gives me one letter grade less than what it is supposed to be. Also, any number 450 to 500, representing an " A " grade does not even register in my Grades Label.

[Code]...

View 7 Replies

Calculating Average And Grade?

Jun 21, 2010

Using VB.NET write a program that can calculate the grade of a student based on his or her marks in five subjects as input according to the following rules:

Grade A: For average between 100 and 80 (inclusive)
Grade B: For average between 79 and 65 (inclusive)
Grade C: For average between 64 and 40 (inclusive)

[code].....

View 2 Replies

Call A Function To Calculate The Average Grade For The Class?

Apr 4, 2012

Write a program that reads in a set of grades for a class.The program takes in the number of students in the class from the user. When the Get Grades button is clicked the program then reads in a grade (0-100) for each student using an inputbox. The program should then display the percentage of students who pass and the percentage of students who fail.The program should call a function to calculate the average grade for the class. Then finally the result is then displayed.

Public Function GetPassRate(ByVal intGrade As Integer) As String
Do Until gradeCounter >= NumericUpDown1.Text
If intGrade >= 40 Then[code].......

View 7 Replies

Calculate And Display Letter Grade

Nov 21, 2010

I have coded this not sure how to get it to display correctly to the lblGrade box. I have set it up for. Supposed to take the average of three grades and display the letter grade for the average of the three grades.

Here is the code
Public Class frmMain
Private Function CalculateGrade _
(ByVal txtTest1 As Decimal, ByVal txtTest2 As Decimal, _
ByVal txtTest3 As Decimal) As String
Dim AverageScore As Double
[Code] .....

View 8 Replies

Getting A Letter Grade Using Select Case?

Dec 14, 2009

I made an application that calculates course grades. The program runs perfectly except for the last part

The the final grade number comes from the label "lblCoursePts" and i want to put the letter grade in the label "lblFInalGrade" Here is what i have.

'Determine the final letter grade
Select Case lblCoursePts.Text
Case 90 To 100 : lblFinalGrade.Text = "A"

[Code]....

View 5 Replies

Enter In A Code For An Overall Letter Grade From A Percentage Given?

Feb 23, 2010

How do you enter in a code for an overall letter grade from a percentage given? I have a seperate box for the letter grade and a seperate one for a the percentage grade . I have it setup when an overall grade and possible grade is entered into boxes it will give me a grade percent but not a letter grade. How is that added? I am doing this for my course project but dont undersatnd the coding very well. I am just trying to pass the class.

View 1 Replies

Letter Grade Based On Test Scores?

Nov 19, 2010

I need someone with patience and can go through a solution with me from the Clearly Visual Basic book. I'm good with computers and can usually learn things relatively fast on my own time and in my own way, but I'm going to school for computer programming and, with certain things, I learn better with things explained to me rather than reading from a book. If someone has the time to go over this solution I'm doing and explain it to me in a way I'd have a better chance of understanding, I'd be truly grateful. I need a tutor, for lack of a better word. The lab I'm doing is from the Clearly Visual Basic book and the instructions are:

Code an application that displays a letter grade based on the averages of three test scores. Code the application using a function to determine and return the letter grade. If the average is at least 90, the grade is A. If the average is at least 80 but less than 90, the grade is B. If the average is at least 70 but less than 80 the grade is C. If the average is at least 60 but less than 70, the grade is D. If the average is below 60, the grade is F.

[Code]...

View 17 Replies

VS 2008 - IndexOf - User Enters A Letter Into A Text Box, And The Output Must Make The Letter Uppercase

Jun 28, 2010

I am a vb newbie having some trouble with an assignment. A user enters a letter into a text box, and the output must make the letter uppercase and tell what position the letter is at in the sentence "The quick brown fox jumps over a lazy dog."

Here is my

Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

[CODE]...............

This is what comes out: "A first occurs in position -1". Everything comes out except the position is always displayed as -1.

View 4 Replies

Application,using A Function To Determine And Return The Letter Grade?

Jun 3, 2011

I have been struggling with my programming class from day one. I still can't seem to grasp the complete logic on how to write code. Anyhow, I have an assignment due that I am stuck on. Here is the assignment:

In this exercise, you code an application that displays a letter grade based on the average of three test scores. Open the Grade Solution (Grade Solution.sln) file, which is contained in the ClearlyVB Chapl8Grade Solution folder. Code the application,using a function to determine and return the letter grade. If the average is at least 90, the grade is A. If the average is at least 80 but less than 90, the grade is B.If the average is at least 70 but less than 80, the grade is C. Tf the average is at least
60 but less than 70, the grade is D. If the average is below 60, the grade is F.

You will be developing the code for the function on your own. Below the Public Class frmMain line, insert this function header:Private Function CalculateGrade(ByVal testScore1 As Decimal, ByVal testScore2 As Decimal, ByVal testscore3 As Decimal) As String

In the function, declare variables for the average score and the letter grade. Calculate the average, use IF/Elself statements to determine the letter grade, and return the letter grade. Create a subprocedure for the Click event for the btnDisplay button. It should call the CalculateGrade function with three arguments ( the three test scores from the text boxes), and display the returned value in the lblGrade box.

[Code]...

View 3 Replies

Letter Grade - Stack Over Flow Exception Was Unhandled

Nov 11, 2009

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

[CODE]...

My code will only let me typ one number into the text box and then it brings me back to the code and says "stack over flow exception was unhandled.

View 5 Replies

Using Parallel One-dimensional Arrays To Calculate A Letter Grade?

Jul 27, 2011

The exercise prior to this one had us use two parallel arrays that store a letter grade (A, B, C, D, F) and the minimum points needed for each grade. The user input the points earned by the student and the program shows their letter grade. It took a minute, but I got that one done, and it does what it's supposed to do.This exercise has us modify that exercise to ask for the (via InputBox in MainForm Load event) total points possible. The grade is then determined by percentage of the total points possible. For instance, if x is the user input, an "A" would be 90% of x.

View 4 Replies

VS 2010 Calculate Average Of Double Inside An Array?

Aug 18, 2011

I'm working with an API, for this I'm using this particular call: [URL]

If i use this, I will get all the .price values:

For i = 0 To .bets.Length - 1
With .bets(i)
Print(.price)
End With
Next

Can I calc the average .price value? I will need to sum all the values as well.

View 8 Replies

VS 2010 Storing Information As A String Within An Array?

Jan 23, 2012

I'll try to explain what i'm doing here, i wan't look through a text file, adding certain lines to an individual array element. So i want to build an array with mcode, mTitle, mCredits, mSemester, moduleStats, currentYear <--- this information as an array element. So here is my attempt at the code,

Dim sr As StreamReader = New StreamReader("datasource.txt")
Dim line = sr.ReadLine() ' get each line and store it
Dim currentYear As Integer

[code].....

View 7 Replies

Average :: Can't Get Output To Appear In Listbox?

Mar 11, 2009

Trying to get the user to put 3 numbers in 3 text boxes and get the average.Private Sub btnAverage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAverage.Click

Dim a As Integer = CInt(txtone.Text)
Dim b As Integer = CInt(txtTwo.Text)
Dim c As Integer = CInt(txtThree.Text)

[code].....

View 3 Replies

VS 2010 Difficulty Storing Textbox Input Into Jagged Array?

Jun 14, 2012

Recently I started a project with the goal being to have text that was inputted into a textbox stored within a three dimensional jagged array. The idea is that every time a button is pressed, whatever text that is inputted into the textbox is split into separate elements, where each word occupies its own element in the array. So for example, if a poem were entered into the textbox and the button clicked, each word of the poem would be assigned to a discrete element in the vertical dimension, and each line of the poem assigned an element in the horizontal dimension. After the text is stored into the 3D jagged array, the text should be cleared from the textbox and a counter should then ensure that on the next button press, the new text inputted into the textbox is stored in a discrete element of the array. Below is the code I have written so far, but I know that I am far from having anything might accomplish what I have just described.

[Code]...

View 9 Replies

VS 2010 Reading From A Sequential Access File And Storing It In An Array?

Feb 9, 2011

what I have to do is read the 5 names inside the Sequential Access File and store them in an array. I'v encountered a problems in storing it in an array. Here's the code

Dim infile As IO.StreamReader
Dim names(4) As String
Dim filename As String = "names.txt"

[Code]....

Theres an error in the code saying that a string cannot be converted into a one dimensional array.

View 5 Replies

VS 2010 : Change Colour Of Text Letter By Letter When Typed?

Jul 5, 2011

Is it possible to change to colour of letters as they are typed.I.e

Piece of text says
"Hello World"

when user types "H". The "H" in the original would change if matched and then so on and then when "Hello" is matched it would change to another colour.

View 1 Replies

VS 2010 Create An Application That Lets A User Enter As Much Grades He Wants?

Oct 5, 2011

I have to create an application that lets a user enter as much grades he wants. The grades are between 0 and 100 and they can't be negative. Whenever the user type -1, the application is done and it shows the average of the grades, the lowest and the highest grades.I absolutly have no idea where to start but i must be using loop/do/while.

View 4 Replies

VS 2010 Have The Code To Display The Min And Max Grade?

Feb 1, 2010

Is there any way to have my code display the min and max grade without having to re due most of it?

View 2 Replies

Getting The Average Of An Array Using FOR NEXT?

Jun 21, 2012

i am trying to get the average of an array of numbers. There could be up to 999 indexes (I picked a large array because of the the numbers of entries the array could have). As you can see I have managed to get the program to calculate the Sum of the in the array, but I am struggling with getting the average.Say, for example, I enter three sets of 90's, I get 3. How do I get an average?(BTW I have programmed it so the numbers go into an List Box, so this is why you see no code to make up the array or to where the array is printing the values).

Dim Sum As Integer
Dim SumCount As Integer
Dim AverageCount As Integer

[code].....

View 7 Replies

Byte Array And Average Value

Jan 28, 2009

i'm working on something to get the average color from an image and the code i have puts all the rgb values into a byte array, so the values are being stored as (r,g,b,r,g,b,r,g,b,r,g,b,r,g,b,etc). how would i loop through each r value to add them to another array to then be able to calculate the average (and so forth for g and b as well).

View 4 Replies

Getting An Average Of An Array, VS 2008?

Mar 5, 2011

trying to give an average of an array in VB MVS2008. I tried using a sample code online but the averages it gives me are completely off. If I enter three ages (20) it gives me an average of 0.6, instead of 20. Here's the code:

Spoiler
Public Class Form1
Dim Names(100) As String
Dim Ages(100) As Integer

[code]....

View 5 Replies

Sum Array Data And Get An Average From It?

Feb 27, 2010

I'm still learning visual basic and I'm kind of stuck. I'm getting the wrong output when I test my data. I'm trying to sum array data and get an average from it. When I print out the average it's way above what it should be. When I enter these numbers 32500, 23000, 38210 I should get an average of 31236.67 but the number I get as the average is 46855.

[Code]...

View 2 Replies

Compute Average On Loop ,array?

Aug 1, 2009

My assignment was to compute design a {Loop, Array } that user inputs grades and calculates the average, Im stuck on the part of computing avg but i

Module Module1
Sub Main()
'Declare Array called Grades with 4 Elements

[code].....

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved