"Wheelerguy" (wheelerguy)
06/30/2018 at 07:00 • Filed to: None | 0 | 14 |
UPDATE:
Am I doing it incorrectly so far?
Wheelerguy
> Wheelerguy
06/30/2018 at 03:22 | 0 |
Context: I was instructed to create a flowchart to determine the rate of a student’s 5 quizzes in 5 subjects, displaying the rate in certain words. I have an idea as to how it would go, but I find the actual flowcharting a bit sketchy.
Manwich - now Keto-Friendly
> Wheelerguy
06/30/2018 at 03:32 | 0 |
Shouldn’t there be a part related to beer consumption in this flow chart?
pip bip - choose Corrour
> Wheelerguy
06/30/2018 at 07:25 | 0 |
no idea.
TheRealBicycleBuck
> Wheelerguy
06/30/2018 at 08:24 | 0 |
There are several problems if you are looking at it from a programming perspective. Each of your declarative statements should have a single equality (i.e. AV=(q1+q2+q3+q4+q5)/5 ). Using SUM and AVERAGE are redundant.
I would switch the if/then statements around:
If score >=
90
, then print “A”
If score >=80, then print “B”
etc.
By slicing from the top score down, you don’t have to put the scores into ranges. Once the score meets the correct criteria, the program will move through that branch of the decision tree,
Wheelerguy
> TheRealBicycleBuck
06/30/2018 at 08:47 | 0 |
the program will move through that branch of the decision tree,
What else ? Any more? Or that’s it? /joke
Either way, thank you. So I’m taking two rectangles away here to use just one rectangle?
Ash78, voting early and often
> TheRealBicycleBuck
06/30/2018 at 08:48 | 2 |
Bingo...just like writing an Excel formula or SQL logic. We call it “waterfalling” at my job — since failing is the largest bucket, it should come last and catch everything not pulled out beforehand. And <= will eliminate the logical overlap at the score cusps.
Wheelerguy
> Ash78, voting early and often
06/30/2018 at 09:06 | 0 |
What does that look like, though, at least for my case?
Ash78, voting early and often
> Wheelerguy
06/30/2018 at 09:13 | 0 |
I’ve never written a flowchart, but basically just reverse the order of all the scores, then add <= to some of the < or > to make sure they fall into one box or another. Right now, a 90 would create an error because it’s not included.
Hope that makes sense.
TheRealBicycleBuck
> Wheelerguy
06/30/2018 at 09:19 | 1 |
Yeah, there’s no need for two. I was more concerned about things like “sum=Aq1+Aq2+Aq3+Aq4+Aq5=x”. That won’t work. Keep it simple. If you want to do it in two steps, then do this:
x=Aq1+Aq2+Aq3+Aq4+Aq5
AV = X/5
Wheelerguy
> TheRealBicycleBuck
06/30/2018 at 09:35 | 0 |
Thank you, now I got the topside done. It’s my decision area that needs work next. To Ash78's thread!
Wheelerguy
> Ash78, voting early and often
06/30/2018 at 09:40 | 0 |
Then I just continue from here?
TheRealBicycleBuck
> Wheelerguy
06/30/2018 at 09:55 | 1 |
Think about this logically. “if av<=100" means if the value of av is less than or equal to 100, print Excellent. That will capture ALL of the average scores because every score is less than or equal to 100.
What you really want is to capture anything greater than or equal to 90. That would be written “if av>=90".
Any score less than 90 would trigger the “No” branch and move down the tree. Any score greater than or equal to 90 would trigger the “Yes” branch and print “Excellent”.
Wheelerguy
> TheRealBicycleBuck
06/30/2018 at 09:59 | 1 |
Ah, now I get it. *slaps self* Thank you again.
Ash78, voting early and often
> Wheelerguy
06/30/2018 at 10:17 | 1 |
Yep, he beat me to it — ditto. The first logical cutoff is 90.