This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:spring2023:cprog:projects:cnv0 [2023/02/28 14:15] – wedge | haas: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: | ||
+ | |||
+ | < | ||
+ | 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 | ||
+ | </ | ||
=====Reference===== | =====Reference===== |