Flow Charts -question

Thread Starter

Gajyamadake

Joined Oct 9, 2019
310
I am posting my chart After verifying many times. I am confident that it will not be wrong

I have fixed my specification

Student StatusScore in Exam
Invalid scoreless than 0 or greater than 100 (-1, 101)
Fail0-29
Pass in Third Division30-44
Pass in Second Division45-64
Pass in First Division65- 74
honours75- 100

1578397052578.png
 

Attachments

Last edited:

Thread Starter

Gajyamadake

Joined Oct 9, 2019
310
You're still only processing the first valid score.
So what is the problem, Once a valid score is found, only then the program will tell whether it is a fail or pass, and if its pass than which grade found

This process is for one student only. If the class has 500 hundred students then I have to make for loop to repeat process for 500 students
 

dl324

Joined Mar 30, 2015
18,326
So what is the problem
Follow your flow chart for a score of 5. How are you supposed go back to process another score? You have the same problem for any valid score. As soon as you categorize the score, you tell the program to stop.

Your compare operations don't make sense.
clipimage.jpg
The first compare operation in each decision element doesn't make sense.
 

Thread Starter

Gajyamadake

Joined Oct 9, 2019
310
Follow your flow chart for a score of 5. How are you supposed go back to process another score? You have the same problem for any valid score. As soon as you categorize the score, you tell the program to stop.

Your compare operations don't make sense.

The first compare operation in each decision element doesn't make sense.
It suppose to know the result of the student. Student can pass or can fail If one student fails, check the result of other student. If the student is pass, then find out which division is, then check the result of other student. do the same process for 500 students.

I thought this would be a better way
 

BobaMosfet

Joined Jul 1, 2009
2,211
The condition in your flow chart is incomplete



This is my first flow chart but I have modified the conditions
View attachment 196252

My question is whether my flow chart follows the given table or not. If not then where it become fail?

Edit: The first priority is to make the correct the flow chart After that i can think of cleaning it as @MrChips said
For performance reasons, you want your code (the algorithm you write that mirrors the flowchart) to be effecient. As such, you don't want to ask question that no longer need answered. Any 'if' statement is a question. If you've already determined the answer based on the score, then you don't want to keep asking 'if' questions for other score values. You only ask questions if you don't yet know the answer.
 

MrChips

Joined Oct 2, 2009
34,810
The TS has not yet understood how to do this after 50 posts.

Here are the first three tests in pseudo-code.

1) If score is less than 0 then tag as invalid and exit
2) else if score is less than 30 then tag as fail and exit
3) else if score is less than 45 then tag as 3rd division pass and exit
4) etc...

Now, the task for TS is to draw the flow-chart for this.
 

dl324

Joined Mar 30, 2015
18,326
If the student is pass, then find out which division is, then check the result of other student. do the same process for 500 students.
The problem is that your flow chart will stop after processing the first valid score:
clipimage.jpg
If the score is 5, you take the branches indicated, and then stop. To process other scores, you need to implement a loop as I did in my example with the connector labeled "1".
 

MrChips

Joined Oct 2, 2009
34,810
I gave you some tips in post #50. Did you follow it?
I used the word EXIT. I did not use STOP.

Look again at post #13 for some more ideas. Keep the structure simple.
 

MrChips

Joined Oct 2, 2009
34,810
You have gone as far as you can go. I do not expect you to improve the flow-chart without further assistance.
Here is how I would draw the flow-chart.
Remember, keep it simple.

Flow Chart.jpg
 

Thread Starter

Gajyamadake

Joined Oct 9, 2019
310
I gave you some tips in post #50. Did you follow it?
I used the word EXIT. I did not use STOP.
MrChips Your chart looks good. I am sorry but can you tell me When my last flow chart won't work Because i don't think i am wrong somewhere logically. Where did you found wrong me except the stop box ?
 
Last edited:

MrChips

Joined Oct 2, 2009
34,810
It is not just about whether a flow-chart would work or not work.
It is also about effective communication.
Can you see where breaking the chart into two tasks is clearer than a single chart?
One task is about iteration. The second task is about assigning the category of a single score.
 

Thread Starter

Gajyamadake

Joined Oct 9, 2019
310
I do not expect you to improve the flow-chart without further assistance.
see post #55, that's why asked what's wrong with my flow chart. anyway I will try to make a clean flow chart like yours

My flow chart is working. I have converted it into code. I have tested all condition and program is working fine

C:
#include<stdio.h>

#define student_size  500

int main()
{
       int score, N;
       for ( N = 0; N <student_size; N++)
       {      
        do {
            printf ("Enter : ");
            scanf("%d", &score);
            if ((score <0)||(score > 100))
               printf("invalid \n");
         }while  ((score <0)||(score > 100));
        if (score < 30)      // range 0 to 100
            printf("fail\n");
        else if (score <45)    //range  30 to 100
             printf("third\n");
        else if (score <65)    // range 40 to 100
              printf("second\n");
        else if (score <75)    //range 65 to 100
              printf("first\n");  
        else // range 75 to 100                                            
             printf("honurs\n");                                                    
       }
     return 0;
}
Edit : I did it as best I could, I think I should go for next flow chart, So that I can learn more and more to clean chart
 
Last edited:
Top