Please enable JavaScript.
Coggle requires JavaScript to display documents.
072629983_A02 (Design: Pseudocode (Output (If the number is prime …
072629983_A02
Design: Pseudocode
- Get inputs from client which is assigned to already claimed variables
- If the number div range of numbers = Integers then it is a factor, use a claimed variable to record each integer
- If the Number > 10^(variable saying how many figures make up the number) then extend the range of calculation (2-10, 11-100, 101- 1000)
- if the client wants to see all factors is true then output: "the factors of this number is : " Then output the factors... If this is not true the step is skipped
- Output: "How many numbers do you want to enter?" "Do you want to see factors?"
- If the factors are equal to just the number (Since 1 doesn't need to be calculated because that will always be a factor) then the number is prime
Output
- If the number is prime Output: This number is prime
- if the number is not prime: Output: "This number is not prime"
Requirement Definition
-
- Checks if the number is prime or not
- Outputs if the number is prime (Optional: Outputs the factors of the number)
- Calculates multiple numbers at once
- Reads file or has user input the data either directly into the code or the code will ask the user for the input the numbers they want to calculate (Optional: user inputs if they want the program to show all factors)
Requirement Analysis
-
Should the program be able to accept multiple numbers at once, if so, how many?
should there be a maximum input. E.g. should the program be able to calculate too infinity. Or should there be a set range to prevent calculation lag
-
-
Processing:
The number will be divided from 2-10, any decimal output will be discarded and integers are kept, if the number is greater than 10 , the range extends to 11 - 100 , and so forth infinitely
since all numbers have a factor of one, it is not checked
-
-