Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

Visual Logic HELP!


  • Please log in to reply

#1
DTran5

DTran5

    New Member

  • Member
  • Pip
  • 1 posts
"I'm currently attempting to create this program to find the largest number. I'm using Visual Logic.

At this moment I have declared the needed variables and started initialize() with an INPUT to find enter the amount of numbers the user wants. Then a for loop that allows the user to enter their numbers. But I'm currently having issue with the upper bound. Let's say I type in 6 as the amount of numbers I want to enter, then I proceed to enter my numbers but my upper bound is 7. How do I fix this??? Thanks!"


I've figured out the problem but now I'm trying to make a for loop with if statement to allow the program to display the largest number. Any suggestions?

Edited by DTran5, 10 April 2013 - 03:23 PM.

  • 0

Advertisements


#2
TheBigHelper

TheBigHelper

    Member

  • Member
  • PipPipPip
  • 546 posts
So now you don't know how to actually build the logic to display the largest number? Is it the displaying part that you're confused about or about finding the largest number.
If it is finding the largest, acccept the values into an array. Make a new variable to store the max number and set it's default value similar to the first value entered into the array. Compare each value with one another using a for loop and each time, update the max number variable with the highest of the two. While the loop has ended, it should hopefully hold the largest number. Then simply display it.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP