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