This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:fall2020:discrete:projects:pnc0 [2020/08/22 22:15] – wedge | haas:fall2020:discrete:projects:pnc0 [2020/09/15 14:13] (current) – [Program Specifications] wedge | ||
---|---|---|---|
Line 263: | Line 263: | ||
* each program is to have no fewer and no more than 2 loops in this prime processing section. | * each program is to have no fewer and no more than 2 loops in this prime processing section. | ||
* in each program, you are not allowed to use a given loop type (for(), while(), do-while()) more than once! | * in each program, you are not allowed to use a given loop type (for(), while(), do-while()) more than once! | ||
- | * display identified primes (space-separated) to a file pointer called **primelist** | + | * display identified primes (space-separated) to a file pointer called **stdout** |
- | * stop your stopwatch immediately following your prime processing loops (and terminating newline display to **primelist**). Calculate the time that has transpired (ending time minus starting time). | + | * stop your stopwatch immediately following your prime processing loops (and terminating newline display to **stdout**). Calculate the time that has transpired (ending time minus starting time). |
- | * output the processing run-time to the file pointer called **timing** | + | * output the processing run-time to the file pointer called **stderr** |
* your output **MUST** conform to the example output in the **execution** section below. This is also a test to see how well you can implement to specifications. Basically: | * your output **MUST** conform to the example output in the **execution** section below. This is also a test to see how well you can implement to specifications. Basically: | ||
* as primes are being displayed, they are space-separated (first prime hugs the left margin), and when all said and done, a newline is issued. | * as primes are being displayed, they are space-separated (first prime hugs the left margin), and when all said and done, a newline is issued. | ||
- | * the timing information will be displayed in accordance to code I will provide below (see the **timing** section). | + | * the timing information will be displayed in accordance to code I will provide below (see the **Timing** section). |
+ | |||
+ | =====Implementation Restrictions===== | ||
+ | |||
+ | As our goal is not only to explore the more subtle concepts of computing but to promote different methods of thinking (and arriving at solutions seemingly in different ways), one of the themes I have been harping on is the stricter adherence to the structured programming philosophy. It isn't just good enough to be able to crank out a solution if you remain blind to the many nuances of the tools we are using, so we will at times be going out of our way to emphasize focus on certain areas that may see less exposure (or avoidance due to it being less familiar). | ||
+ | |||
+ | As such, the following implementation restrictions are also in place: | ||
+ | |||
+ | * use any **break** or **continue**, | ||
+ | * **justification** implies some thoughtful why/how style comments explaining how a particular use of one of these statements is effective and efficient (not: "I couldn' | ||
+ | * absolutely **NO** infinite loops (**while(1)** or the like). | ||
+ | * no forced redirection of the flow of the process (no seeking to the end of the file to grab a max size only to zip back somewhere else: deal with the data in as you are naturally encountering it; no telling; no " | ||
+ | * All " | ||
+ | * **NO** logic shunts (ie having an if statement nested inside a loop to bypass an undesirable iteration)- this should be handled by the loop condition! | ||
+ | * at most, only **one** return() statement per function. Error terminations should use **exit()** | ||
+ | |||
+ | Write clean, well-indented, | ||
=====Grabit Integration===== | =====Grabit Integration===== |