Find The Lowest Test Score In The Array And Display It In The Associated Label Using A DoLoop?
Jun 7, 2011
My objective is to find the lowest test score in the array and display it in the associated label using a DoLoop. However, I don't think I was to use the ForNext stmt.Could I have used the DoLoop without the ForNext? ' displays the lowest test score stored in an array
Dim testScores() As Integer = {14, 82, 94, 77, 11, 95, 38, 62}
Dim lowest As Integer = testScores(0)
Do
For subscript As Integer = 1 To testScores.Length - 1
I am writing a noughts and crosses game and I want to be able to keep score everytime each character wins a game, I have written a sub routine to handle this but it seems to count up in 5's and 10's??I have used a global variable like this Dim i As Integer = 1 then declaired that variable in my sub like this i += 1 (I thaught that this would just add 1 everytime X won a game)then used the variable i to add the score to the label control that keeps the score for the character X.My question is, am I using the correct syntax (+=) for the variable.
Haveing troubles with an assignment. I am writting code that will allow user to enter a score and the program returns a grade based on the score entered. I can get it to work using "IF" statements but want to use code for ranges. My "IF" code is as follows.......
I have been working on a class project for sometime now. Currently stuck and need some help. Project is due today, so I'm desperate for some help. Please see attached project file.
i just got another assignment with no instruction on how to do it. I have no prior programming skill so these assignment are really hard for me, [URL]..
I'm new to VB and I'm doing a calculations program for test scores. I got everything setup for my clear and exit buttons but not sure what I have to put in the calculate button code for it to calculate. Here is what I have so far.
Public Class Form1 Private Sub Label5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblTestScore5.Click End Sub Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click [Code] .....
I have to take information that is entered in a text box such as name, test score then send it to a list box then from there I have to split the test score and calculate the grade. I have been trying to find information on how to separate the test score to do the calculation.
I am currently going through Murachs Beggining .net programming book. I am trying to implement an application for an exercise at the end of chapter 5. The application specification is as follows.
I'm not sure where I'm going wrong with this. it's supposed to let the user add scores to the list, then calculate the total, average, and count. However, it doesn't let me add more values to the list. Any help whatsoever would be awesome! Keep in mind, I am new to VB and programming languages, and was just playing around with code hoping for any sort of positive result, and therefore some of the code may not be necessary, or make sense. Here's what I have now:
For this assignment, the user has to enter 10 number and my msgbox will show the number of negative number aswell as the lowest number.here's what i,ve come up with
Quote:
Dim innombre As Integer Dim innbrnegatif As Integer Dim inpetit As Integer
[code]....
how to find the lowest value and obviously i'm not able to show the number of negativ number.
Dim innombre As Integer Dim innbrnegatif As Integer Dim inpetit As Integer
[code]....
I was able to make the program work for the smallest number but it doesn't show the number of negative number.2nd edit: i changed the innombre to innbrnegatif+1 in the nbrnegatif = innbrnombre+1 and now it seems to be working.
How can I find a listbox average removing the 2 lowest number? I tried DimintSmall AsInteger intSmall = lstGrades.Items.Item(0) ForEachItem AsIntegerInlstGrades.Items IfItem < intSmall Then intSmall = Item EndIf Next lstGrades.SelectedItem = intSmall I cant select or remove it
I am attempting to create a program that opens a file and reads the contents to then display them in a set of four text boxes (e.g. id, firstName, lastName, avg.Salary). it stores the data in an array.
i have done all that i can do, however, i wish to display in a label something similar to this "5/10 (5th record of a total of 10)" meaning the 5th record in the array out of a total of 10 records. i have already done the code to display the total amount of items in the array, that part was simple, but i can't get my head around trying to code something that will display the record that i am currently viewing in the text boxes.
i have a "view previous record" and a "view next record" button that will go through to the next or previous record, in doing so will change the "5/10" records to the next appropriate number, e.g. "5/10" goes to "4/10" if the previous button is pressed (in doing so, obviously the records that are shown in the text boxes will change to the next or previous record)[code]...
I need a way to detect which one is the largest, and which is the smallest, and assign them to a variable.If SideA is the largest, then it is variable C, and SideB is the smallest, so its variable A, leaving SideC as variable B
Entered an 5 elements of an array so is has 4 index? I need to find the lowest and highest element of an array and their index position Example: I enter 1 2 3 4 5 The output should be like this The lowest is 1 and position of index is 0 The highest is 5 and position of index = 4
To clarify - I'm building a simple game in visual basic and I'm trying to create a simple file to record and display the "Best Score" from each game. Actually there are four levels in this game (each one is on a different form) - I'm trying to save the best score from each level to display in a separate Game Stats form. Therefore I creating a datatable on one form, but then trying to get all my other forms to access it.
But now I get a new DBNull error message in part of code not of my making - NewGameDataSet.Designer.vb Error Message = "The value for column 'BestScoreEasy' in table 'GameTable' is DBNull." Does this mean I need another New Statement somewhere?
Haveing troubles with an assignment. I am writting code that will allow user to enter a score and the program returns a grade based on the score entered. I can get it to work using "IF" statements but want to use code for ranges. My "IF" code is as follows.......
My objective is to find the lowest test score in the array and display it in the associated label using a DoLoop. However, I don't think I was to use the ForNext stmt.Could I have used the DoLoop without the ForNext? ' displays the lowest test score stored in an array
Dim testScores() As Integer = {14, 82, 94, 77, 11, 95, 38, 62} Dim lowest As Integer = testScores(0) Do
I'm try to hide the label after few second but it is updating page continuously after 10sec, i just want it once time when i click save button label on display me successfully for 10sec and get disappear
i am developing a web browser in vb.net as my final year project.currently working on displaying browsing history in labels contained in a panel . i have coded label array dynamic in size , using redim stmnt in some method say abc () . now i want to handle event generaten on clicking these label .but i have no idea how to do it .
Public Class frmhistory Dim domainarray(50) As String Dim lblpagename() As Label
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click Dim numberFile As StreamReader Dim intCount As Integer Dim decTotal As Decimal Dim decAvg As Decimal
[code]....
0 value returns for the Lowest number..everything else returns fine...
On my windows form i have textbox where the user will be entering XML data. What i want to be able to achieve is to search for a field called DESCRIPTION= and check that the text included contains certain characters?How can i get the tool to first find the DESCRIPTION= and test the characters contained with the " (quote marks)?
For example:
DESCRIPTION="hello & welcome"
I want my tool to look for certain characters like < > and & and when it finds one to have a error msg pop up and inform the user that the character will then be escaped for it's HTML entity, i.e & becomes &?
I need assistance with posting lines from a text file (test scores) into an array. From there, I'll have to average the test scores, find the standard deviation (without using the built in function) and assign grades based on the test scores' deviation. I have already written the code for the user to search and upload a text file. And I should be able to do the standard deviation of the array, if someone can help give me an example of how to send the text file to array and average the lines of the array without using the built in math functions.
I've created a program that requires students to answer addition questions.I have the code so that it calculates if the answer is correct, along with outputing the correct answer into a textbox.If the answer is correct the textbox background colour changes to green.If the answer is inocrrect the textbox background colour changes to red.I've done this using an array, and I want to use this array to calculate how many questions the students have answered correctly, and output them onto another page.I'm not sure is something like this would work:I was thinking about giving the textbox that outputs the grade score a value of 10. For every red box that is highlighted, 1 is taken away from the texbox value, outputting the amount of questions the user has answered correctly.Here is my array so far, not including the ability to output how many answers the student has answered correctly.
Public Num1(10), Num2(10) As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
I have to write a program for a user to take a 20 question test (A, B, C, D). The users answers will be stored in an array and compared with a 2nd array that has the correct answers. Its then supposed to go to a 2nd form when you click show score, grade it, and display whether each answer was right or wrong. I'm missing something easy probably.