Finding Maximum Value In A Group Of 11 Numbers?

Mar 16, 2011

i am creating a maths program that works out five number summarys of a range of data. i am having trouble working out the smallest number in a group of numbers. i have used a bunch of if then statements to work out the maximum and i figured that by exchanging a few variables and swapping greater than signs for less than i could use the same code to work out the minimum, but all i get is zero, no matter what i input into my textboxes. below is the code i have used to work out the maximum number

If CheckBox1.Checked = True And CheckBox6.Checked = True Then
max = 0
min = 1000

[Code]......

View 14 Replies


ADVERTISEMENT

Project - Average Numbers, Maximum And Minimum Values, Range Of The Numbers

Apr 7, 2009

Im trying to write a program that will do:

1.The average of the four numbers. This answer will be placed into a text box reserved for that value. This text box cannot be changed by the user.

2.The maximum and minimum values. These will be denoted by changing the color of the largest number green and the smallest number red.

3.The range of the numbers. The range is defined as the difference between the largest and smallest numbers. The range will be placed into its own text box, labeled as such. This text box cannot be changed by the user."

Im using visual studio 2008 and it has to be written in VB

View 35 Replies

Finding Maximum Value In A List Item?

Jan 23, 2012

I feel there must be a single line, more elegant way to find the highest page number in my list of report pages. The code below works fine but seems verbose. Is there a better way?

Dim numofpages As Integer = 0
For Each reportrow In reportlist
If reportrow.reportpage > numofpages Then numofpages = reportrow.reportpage

[code].....

View 2 Replies

Finding Maximum Value In Column Of Table?

Nov 9, 2010

I've tried to use the DMAX Function in my VB windows application to find the highest value in a column in one of my tables, however it doesn't seem to work. After doing some research, I think that the function is only relevant to VBA, although I could be wrong.

'show me the maximum HCCID - DMAX
'Dim HCCNUM As Int32
'HCCNUM = DMAX("[HCCID]", "tblHCC")

How to find the maximum value in a column in one of the tables in my database?

View 12 Replies

Finding A String Between 2 Other Strings That Has A Minimum Length Of 5 A Maximum Of 7 And Contains 2 Dots

Oct 5, 2011

What I need to do is find a string that can be any value, and is placed between ">" and "</" with a minimun length of 5 and a maximum length of 7 and contains exactly 2 dots.

So if I have a text file like this:

<a href="www.site.com">a site</a>
text<br />
More test<br />

[Code]....

I want it to find only the 5.0.77. And no, the number isn't always between h2 tags, and the number isn't even always the same. The only thing that is static about it is that is is between ">" and "</" and that it is between 5 and 7 characters and contains 2 dots.

View 1 Replies

Finding - Suburbs With Minimum And Maximum Percentage POS (public Open Space)

Oct 11, 2011

I am working on this exercise where i have to find suburbs with minimum and maximum percentage POS (public open space).

I manage to get the minimum and maximum but i need a way to allow for two or more suburbs with same minimum or maximum.. for examplethree subrubs ( suburb A, suburb B, and suburb C) all has same POS of 2%, then i need to list the three in the list box as minimum with subrub name(from my code i can get only one) with the maximum values as well( allow two or more suburbs with same maximum in a similar way)..

Below is the code.. i have removed some codes to make it read easy whi are not relevant.. i got POS percentage correct and i wanna start from there..

CODE:

View 1 Replies

Get The Maximum Value Of Two Numbers?

Jul 24, 2011

I'm trying to get the maximum value of two numbers.I want my variable z to be equal to the maximum between x and y

View 5 Replies

Generate The Maximum Number I Enter/type Within 3 Or More Numbers Using Math.max?

Feb 7, 2011

how can i code a simple program to generate the maximum number i enter/type within 3 or more numbers using math.max. for example, if i enter 25, 60, 45 how can i use math.max to calculate the largest value out of the 3 numbers?

View 4 Replies

Finding Average Of 2 Largest Numbers?

Feb 21, 2009

I am supposed to create a program that inputs 3 numbers, takes the two largest and outputs an average of those two numbers using simple ifelse statements and logical operators only. I can't seem to get it. I've messed around for a few hours now and nothing seems to be working.

Here's what I have:

Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click
Dim score1 As Double

[Code].....

View 8 Replies

Finding Average Of Numbers In A List Box's?

May 4, 2010

Need to calculate Average Plan Duration for the 3 Shipment TypesSo far i haveQuote:

'CALCULATING AVERAGE DURATION FOR STANDARD
Dim iAverage As Integer
Dim iAvgDuration As Integer

[code]....

I uses the information from the list boxes, (lbShipmentDuration) and (lbShipmentMethod) to calcualte the average Duration for each Shipment Type.

View 19 Replies

Finding The Average Of A Set Of Numbers In A Listbox In VB?

Jun 20, 2012

I enter numbers and Names into a text box and click 'add to list'. THe names go into a seperate listbox to the numbers.I then press 'show me the list' and i get to view my numbers and names listed in the two listboxs. I also have a button which averages the numbers in the numbers list box. But i dont know how to get it to work I will divide by the number of items in the list box.note: The average will be displayed in a label called: lblavg

Here is a picture of my code: http:puu.sh/CsED
I have tried:
For each item In lstListAges.Selecteditems

[code]....

View 6 Replies

Ordering Eleven Numbers And Finding The Mean?

Mar 23, 2011

i am creating a maths program that works out five number summarys of a range of data. i am having trouble working out the median in a group of numbers.so far i have used the code below to declare all the the inputs.

dim m as integer
no1 = Val(TextBox1.Text)
no2 = Val(TextBox2.Text)
no3 = Val(TextBox3.Text)

[Code]...

i am completly stuck for how to order the variables, and find the middle no.. as i am using 11 variables, the middle no would be the 6th in the order..

View 4 Replies

VS 2008 Finding A Set Of Numbers In A String?

Mar 23, 2011

I am needing to locate a given set of numbers in a string, and have limited success, it is almost always finding the numbers that I want, but I need it to be more reliable.Below is a test program that I am using to test with and also 2 picures that may explain better that I can put into words.

[Code]...

View 6 Replies

Finding Computer Names And Serial Numbers

Feb 12, 2011

I wrote this sub routine that is running, but it only returns the local Computer name and Serial number. Any one know the why to grab the Computer name and serial by IP address? I am using VB 2010.

[Code]...

View 2 Replies

Make A Program For Finding Prime Numbers?

Dec 21, 2011

I needed to make a program for finding prime numbers. The logic is that you have to put limits n & m and then LOOP and odd-integer P between n & m inclusive. I have a button to click on my form that displays 2 message boxes, one saying " enter upper limit" and the other say "enter lower limit". I need now to get the results of the odd prime numbers between the limits into a list box!

Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

[Code].....

View 39 Replies

VS 2008 - Finding 3 Equal Numbers Out Of 5 Random

Apr 23, 2011

I have a program I'm working on (a chance game) that has 5 random numbers generated. I need to think of an expression to check to see if three of those numbers are equal. The random values are not an array, they are 5 separate variables. I have the code written to compare if there are two matching ones, but am having trouble thinking past that. [Code]

View 3 Replies

VS 2008 Finding All Numeric Combinations Of A Set Of Numbers?

Jun 7, 2009

I am trying to create a program that can figure out all the different combinations of numbers in a string.

View 2 Replies

Create A Program To List A Large Group Of Numbers?

Feb 7, 2011

I am currently trying to create a program to list a large group of numbers for me. My final goal is to have every 2, 3, 4, ..., and 9 digit number containing only "1" "2" and "3". I thought I would go about this by using the following VB.NET program and then copying it into a text editor, and using find & replace to eliminate all other numbers.

Public Class Form1
Dim Start As Integer = 333333333
Dim Counter As Integer = 333333333

[Code].....

it fails due to the massive amount of processing that needs to take place. However, adding the intervals requires a great deal of time for each number to be displayed without any crashes.

Is there some way (in VB.NEt or another language) to get the number list I want in a short (an hour or less) amount of time?

View 7 Replies

Find The Mode Or Popularity Of A Number In A Group Of Numbers In .NET?

May 13, 2011

Say for instance, I gave you the numbers

1, 2, 3, 4, 4, 6, 9, 1, 3, 4, 5, 5, 2, 4, 7, 9, 1, 5, 3, 6, 6, 8, 1, 1, 4, 7, 7, 8, 2, 4, 2, 1, 9, 1, 0, 1, 6, 3, 2, 1, 8, 8, 9, 8, 1, 5, 3, 2, 3, 4, 7, 9, 0, 1, 2, 4, 7, 4, 3, 9, 7, 2, 0, 1, 6, 3, 8, 1, 2, 4

What number appears more than any other number?This is very important to me, ...I need to find the MODE, of those group of numbers, ...the way that I did it before, I would make 10 TextBoxes, and have another text box to enter the number, and when the number gets entered it would increment the value of which ever textbox the number was in the main textbox, so if I entered a 1 into the main textbox, then the zero in textbox (1), would be incremented to 1, and if another 1 was enered and the button was clicked, the 1 in the Textbox for 1, would be incremented to 2, because 1 has a popularity of 2 now and has apeared 2 times..

Here's some code, to show what I've come up with by myself.

Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ONE.Text = ONE.Text + 1
End If

[code]....

View 8 Replies

Calculate Maximum Or Minimum Of "x" Numbers?

Sep 27, 2011

Calculate maximum or minimum of "x" numbers

View 2 Replies

Plugging In Random Numbers To Load From Group Of Numerical Filenames

Feb 11, 2012

Old VB6er trying to get the new syntax of the .net world. Just to get things up and running, I wrote the following:

Dim RandomNumber As Integer
RandomNumber = GetRandom(0, 13)
If RandomNumber = 0 Then
Try
bass00.Play()
[Code] .....

What's the proper syntax for plugging in the random number instead of hard coding the bass02.Play() lines? VS 2010

View 4 Replies

VS 2008 Find Highest And Lowest Number In Group Of Numbers

Apr 26, 2009

I have a group of 3 numbers:

-SideA
-SideB
-SideC

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

View 2 Replies

Sql - Finding Start And End Dates From Date Numbers Table (Date Durations)?

Jun 19, 2009

I have two tables: a schedule table that contains information about how an employee is scheduled and a numbers table in which each number corresponds to a date.

[Code]...

I can do this on the SQL side or the code side. I have Linq at my disposal if I need it. The table doesn't need to be compiled by SQL. This will happen dynamically on a website and should be as efficient as possible.I don't want to have to iterate through each and look for breaks in contiguous days if I don't have to.

View 4 Replies

See If Current User's Group Name Matches A Specified Group Name Using Active Directory Roles And SID's?

May 3, 2011

I'm trying to match up a specific group name and see if it exists for the currently logged in user using Active Directory roles. If the Group Name exists for the Current User, I want that group name to be displayed in a drop down list. Example: If current user is in BIG Group, display BIG in drop down list.Problem: All I am getting is SIDs and I'm not able to get anything to match up to the group name and nothing will show up in the drop down list.I also get the following Error:Error: Object variable or WIth block variable not set.How do I fix this?? here is the code I am using:

Private Sub GetMarketingCompanies()
' code to populate marketing company drop down list based on the current logged in users active directory group that

[code].....

View 3 Replies

Enumerate If An Active Directory Group's Member Is User Or Another Group

Jan 31, 2011

Enumerate if an Active Directory group's member is user or another group

View 1 Replies

Reference A Group Of Controls Inside A Group Box?

Jan 1, 2011

I am writing an application and I do not know how to reference a group of controls inside a group box. I will include the code I have written so far and a picture with a detailed explanation as to what I am trying to do. Feel free to comment on any discrepancies that you may notice in my code.

Code:

Public Class Form1
' The following class-level constants are used
' to calculate the price of the model
Const decCOUPE As Decimal = 18000

[code].....

View 3 Replies

Remove All Items In A Listview Group And The Group Name?

Sep 25, 2011

I want to remove a group (include all items in this group) in ListView, but unsuccessful, the code is below, why?

ListView1.Groups("GroupName").Items.Clear()
ListView1.Groups.Remove(ListView1.Groups("GroupName"))

View 4 Replies

Urgent Add Activedirectory Group To A Local Group?

Apr 6, 2011

anyone have some quick code on how to do this?

wmi is not a option.

View 1 Replies

Divide The Content In My Application To Groups Each Group Has Its Own Rectangle Border With The Group Name Located At The Top Border

Jul 22, 2009

I want to divide the content in my application to groups each group has its own rectangle border with the group name located at the top border, i've seen it before and i'm not sure what is the correct name of this control, anyone knows what I'm talking about ? EDIT: Ok, I found the Groupbox Control but how do i use it? should i just drag other controls inside it or i should add controls directly into it?

View 2 Replies

Remove AD Group From Group?

Jul 25, 2011

I have this code I've used multiple times to add and remove users from AD groups, but when I try to use it to remove an AD group from another AD group it fails with "The server is unwilling" [code]...

View 1 Replies







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