User Tools

Site Tools


haas:spring2023:cprog:projects:cnv0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
haas:spring2023:cprog:projects:cnv0 [2023/02/28 14:15] wedgehaas:spring2023:cprog:projects:cnv0 [2023/02/28 14:35] (current) – [Process] wedge
Line 273: Line 273:
  
 The execution of the program is short and simple- obtain the input, do the processing, produce the output, and then terminate. The execution of the program is short and simple- obtain the input, do the processing, produce the output, and then terminate.
 +
 +=====Process=====
 +In general, you will be looking to do something like the following:
 +
 +<code>
 +DISPLAY PROMPT
 +READ NUMBER
 +
 +SHOULD NUMBER BE LOWER THAN TWO:
 +    DISPLAY AN ERROR
 +    EXIT WITH A NON-ZERO STATUS
 +
 +SO LONG AS FACTOR IS LESS THAN NUMBER:
 +    SHOULD THE FACTOR BE A LEGITIMATE FACTOR OF NUMBER:
 +        INCREMENT COUNT OF FACTOR PAIRS
 +        SHOULD THIS NUMBER HAVE A SQUARE FACTOR:
 +            INCREMENT COUNT OF FACTOR PAIRS
 +
 +SHOULD THE NUMBER OF FACTOR PAIRS MATCH WHAT WE ARE LOOKING FOR:
 +    DISPLAY THAT NUMBER BEING PROCESSED IS OF THE NEEDED TYPE
 +OTHERWISE:
 +    DISPLAY THAT THE NUMBER BEING PROCESSED IS NOT THE NEEDED TYPE
 +</code>
  
 =====Reference===== =====Reference=====
haas/spring2023/cprog/projects/cnv0.1677593758.txt.gz · Last modified: 2023/02/28 14:15 by wedge