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

# Visual Logic Flowcharts

### #1 Sparklies Posted 06 March 2006 - 12:49 PM

Sparklies

Member

• Member
• 11 posts

Hi.

I am a current college student taking Programming Logic and Technique. This class uses VisualLogic for now and eventually VBasic.net

below is the problem i am working on. I need help w/ the program to compute averages when the exact # of values being entered is unknown.

==============

Write a new program that reads a list of values from the user until the user enters the sentinel value -1. At that point the program should display the average of the values entered (not including the sentinel).

==============

Edited by Sparklies, 06 March 2006 - 03:06 PM.

• 0

### #2 gust0208 Posted 06 March 2006 - 08:49 PM

gust0208

Member

• Member
• 311 posts
Hello Sparklies and welcome to the forum,

I will put down the rough pseudocode for this algorithm and you can refine to match the exact criteria:

Initialize num_of_inputs to 0 (will hold the number of values entered by user)
Initialize sum_input_values to 0 (will hold the running total of all the values entered
Initialize value_average to 0 (will be used to hold average of the values at end of algorithm)
[BEGIN LOOP]
Get user input into current_value
sum_input_values = sum_input_values + current_value
num_of_inputs = num_of_inputs + 1
Ask user if they have more values to enter: Y/N
[END LOOP]
If Y --> go back to [BEGIN LOOP]
If N --> output average of inputted values
value_average = sum_input_values / num_of_inputs
Print to user: "Average value of " num_of_inputs " is " value_average

Hope that helps seeing my take on the pseudocode to solve this problem.

Cheers,
Tom

Hi.

I am a current college student taking Programming Logic and Technique. This class uses VisualLogic for now and eventually VBasic.net

below is the problem i am working on. I need help w/ the program to compute averages when the exact # of values being entered is unknown.

==============

Write a new program that reads a list of values from the user until the user enters the sentinel value -1. At that point the program should display the average of the values entered (not including the sentinel).

==============

• 0

### #3 Sparklies Posted 07 March 2006 - 04:44 PM

Sparklies

Member

• Topic Starter
• Member
• 11 posts
Thanks, Tom...

Worked out nicely.
Much appreciate the help

<ME>
• 0

### Similar Topics

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users