- 2,163
- 191
I couldn't test it cause the class was in the early morning. But my teacher excepted it so Idk it caused no problem.But for today I have to make 2 more flowcharts...
The discussion revolves around creating an algorithm to determine whether a given number (N) is prime. Participants explore various algorithmic approaches, including the use of loops and flowcharts, while addressing specific steps and potential improvements to the proposed algorithm.
Participants express differing views on the effectiveness and clarity of the proposed algorithm. There is no consensus on a single approach, as some advocate for simplification while others defend the original structure.
Participants note limitations in the algorithm's current form, including unnecessary checks and the potential for confusion with step definitions. The discussion highlights the need for clearer logical flow and the importance of efficient prime-checking methods.
It's rather sad if the flowcharts you have to write are a lot less clear than the computer program would be. In this case you really want it to be clear in your program for which values of m the trial division is done. if you haveArman777 said:I couldn't test it cause the class was in the early morning. But my teacher excepted it so Idk it caused no problem.But for today I have to make 2 more flowcharts...
for m in range (2, n/2):
for (m=2; m<= n/2; m++)
I don't know ho to write a program we didnt learn about it..But I see your point in general and you are right. Maybe yeah it was the problem. So now I have to create a flowchart to calculate a gcd for two positive integers.willem2 said:If you really have to make flowcharts, i would recommend to make and test a correct program first,