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 Flowcharts


  • Please log in to reply

#1
Sparklies

Sparklies

    Member

  • Member
  • PipPip
  • 11 posts
:tazz:
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

Advertisements


#2
gust0208

gust0208

    Member

  • Member
  • PipPipPip
  • 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

:tazz:
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

Sparklies

    Member

  • Topic Starter
  • Member
  • PipPip
  • 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

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP