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

Flow Chart Help


  • Please log in to reply

#1
lakitu

lakitu

    New Member

  • Member
  • Pip
  • 3 posts
hi everyone!

I am struggling to figure out a way to solve this problem and would appreciate any help. Basically I need a flowchart that will calculate the area of squares. The user will have to input the length of the square(L), and how many squares he needs(N) but also the square size increment(I)

eg . L = 10, N = 4, I = 2 then three square areas of

L = 10, L = 12 and L = 14 L = 16 will be calculated and displayed.

I figured out i will need to do thes actions.

- intitialize the values of A and B.
- calculate the area of a square.
- increment the values of A and B.
- test the value of B against N, and loops back if there are more squares to calculate.


This is what I have done so far I am struggling on how i can intialize the values of A and B I think i have done this wrong.

Note * the flowchart is in two doc files*
Flowcharts

Any help on how i can make this flowchart work would be grately appreciated.
  • 0

Advertisements


#2
lakitu

lakitu

    New Member

  • Topic Starter
  • Member
  • Pip
  • 3 posts
Hi can anyone help I just need help as to how to intialize the values of A and B ? Any guidance would be great.
  • 0

#3
gust0208

gust0208

    Member

  • Member
  • PipPipPip
  • 311 posts
Hey lakitu,

First, I was a bit confused by your description of the program and the example, you say three squares will be printed, but then list four values?

I will do my best. You will want to initialize the value of B (= N-1) before entering the loop of your flowsheet. The way it is now, everytime it loops, B will be reset to N-1 as opposed to B=B+1.

If I were making the algorithm, I would initialize B to 0 and then increment it until it equals N. I like how you have A initialized within the loop and will hold the total area of the squares. I will try and write out how I would do the flowsheet with initialization.

Input first square length (L)
Input number of squares to calculate (N)
Input size increment (I)
Initialize (# of squares counter so far) B to 0
Initialize (total area of square) A to 0
[ENTER LOOP]
A = [(L + (I * B)) * (L + (I * B))] {Calculate area of current square)
*** See that using B in the calculation will automatically scale the value up as we go through the loop
Print(A) [Print current total area of squares]
B = B + 1 [Increment B, the square counter]
[DOES B == (N - 1) ?]
If yes --> Finish / End program
If no --> loop back up to [ENTER LOOP]

This would produce the input that seems to match your flowsheet goal (printed area of N # of squares).

Cheers,
Tom


Hi can anyone help I just need help as to how to intialize the values of A and B ? Any guidance would be great.


  • 0

#4
lakitu

lakitu

    New Member

  • Topic Starter
  • Member
  • Pip
  • 3 posts
Hi Tom,

Thank you for your input and time. I have to say that yours deffinetly makes more sense than mine, I have been trying to figure than out for a week now!

Cheers

Lakitu :tazz:
  • 0

#5
gust0208

gust0208

    Member

  • Member
  • PipPipPip
  • 311 posts
Glad to be able to help out. Post back if you have any more questions about the flowsheet algorithm.

Cheers,
Tom

Hi Tom,

Thank you for your input and time. I have to say that yours deffinetly makes more sense than mine, I have been trying to figure than out for a week now!

Cheers

Lakitu :tazz:


  • 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