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

# Flow Chart Help

### #1 lakitu Posted 27 February 2006 - 03:08 PM

lakitu

New Member

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

### #2 lakitu Posted 28 February 2006 - 01:42 PM

lakitu

New Member

• Topic Starter
• Member
• 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 Posted 28 February 2006 - 04:45 PM

gust0208

Member

• Member
• 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 Posted 01 March 2006 - 09:57 AM

lakitu

New Member

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

### #5 gust0208 Posted 01 March 2006 - 10:36 AM

gust0208

Member

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

• 0

### Similar Topics

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

0 members, 0 guests, 0 anonymous users