Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
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