Jump to content

Flow chart logic error?

ohJey

Is this a logic error?

This is the flow chart my teacher gave me for a program that solves the quadratic formula

how could b^2-4ac not be >= 0 and b^2 be much greater than 4ac at the same time?

Capture.PNG

Linux "nerd".  If I helped you please like my post and maybe add me as a friend :)  ^_^!

Link to comment
Share on other sites

Link to post
Share on other sites

Bit of a guess this, often these things are trick questions to make you R&D and learn, but from 1st glance, there is no decision on No side of circled decision so variable would inject into that and could be yes at same time resulting in 2 forumlae end points. but this could be process flow logic graph drawing error. 

 

By design, process flow diagrams if done correctly cannot result in multiple decisions being correct at the same, otherwise you need to revise the flow diagram to make sure the path has a decision and correctly resolved. Same for electronic design.

 

how is the >> operator processed in this environment / language?

 

might want to look into how binary operators work?

>>   right shift            integer >> unsigned integer
Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, Starglider said:

Bit of a guess this, often these things are trick questions to make you R&D and learn, but from 1st glance, there is no decision on No side of circled decision so variable would inject into that and could be yes at same time resulting in 2 forumlae end points. but this could be process flow logic graph drawing error. 

 

By design, process flow diagrams if done correctly cannot result in multiple decisions being correct at the same, otherwise you need to revise the flow diagram to make sure the path has a decision and correctly resolved. Same for electronic design.

I'm looking at the previous "no".  If the previous statement (b^2-4ac>=0) is "no", then how could (b^2>>4ac) be "yes"? 

Linux "nerd".  If I helped you please like my post and maybe add me as a friend :)  ^_^!

Link to comment
Share on other sites

Link to post
Share on other sites

It's been many years since I've been doing this stuff, but certain equations can result in 2 answers and thus 2 values go through the process flow.

 

But by design, logical operators, depending on what you use but >= , <= etc only match one. 

 

About all I can remember...

 

Quadratic can be + or - if memory is correct?

Link to comment
Share on other sites

Link to post
Share on other sites

ensure bodbas is followed to ensure processing of sides, could also be a trick questions and often result in a different answer

Link to comment
Share on other sites

Link to post
Share on other sites

It can't be that is definitely a logic error. Its also an irrelevant decision because you use the stable formula either way so why bother even asking the question if both branches are identical.

Link to comment
Share on other sites

Link to post
Share on other sites

An operator cannot defy its function.

 

Quadratic has two answers (in theory).

 

however, if logic flow chart is run via single value, and it is correct, and you put a conditional test on what you are trying to prevent, it will never be wrong, thus the flow chart is incorrect or incomplete.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×