本文发表在 rolia.net 枫下论坛Friends,
Attached is a set of assignments that one of my friends was asked to implement in C++ and Java. Our forum abounds in gurus. Please comment on the following questions. (Frankly speaking, I feel they are very thorny, though I have implemented 3 in Java quickly and 4 elegantly in Java 2D). Thanks.
---------------------------------
>Here are the programming questions that I would like you to do:
>
>1. Write a program using shared memory:
>a. one process writing "CooperNeff"
>b. the other process reading this in, and print out to the standard
>output.
>
>2. Folking process:
>printout "CooperNeff" character by character, and each one is done by one
>single process
>
>3. write a program with two threads. One thread is doing n+=1. Every 50
>times, this thread will
>push the result onto a second thread.
>The second thread will print out the result pushed by thread one.
>
>4. a simple Java GUI to plot two series, with (x,y1) and (x,y2) variables.
>(eg, (x,y1) = (1,10), (2,15), (3.3, -10)
>(x,y2) = (1,-3), (2, 9), (3.3, -8) )
>
>5 write a class derived from both iostream and priority queue? This class
>should be able to handle
>a. take a couple stock objects into stream. (overloads << operator)
>b. when flushing, it will print out to standard output in the order of
>either ticker (a string type) or price (a double type) within the stock
>object. This choice can be set by the user.
>The stock objects are:
>class Stock {
>string ticker;
>double price;
>};
>with {"IBM", 120.0}, {"INTC", 60}, {"AMAT", 75}更多精彩文章及讨论,请光临枫下论坛 rolia.net
Attached is a set of assignments that one of my friends was asked to implement in C++ and Java. Our forum abounds in gurus. Please comment on the following questions. (Frankly speaking, I feel they are very thorny, though I have implemented 3 in Java quickly and 4 elegantly in Java 2D). Thanks.
---------------------------------
>Here are the programming questions that I would like you to do:
>
>1. Write a program using shared memory:
>a. one process writing "CooperNeff"
>b. the other process reading this in, and print out to the standard
>output.
>
>2. Folking process:
>printout "CooperNeff" character by character, and each one is done by one
>single process
>
>3. write a program with two threads. One thread is doing n+=1. Every 50
>times, this thread will
>push the result onto a second thread.
>The second thread will print out the result pushed by thread one.
>
>4. a simple Java GUI to plot two series, with (x,y1) and (x,y2) variables.
>(eg, (x,y1) = (1,10), (2,15), (3.3, -10)
>(x,y2) = (1,-3), (2, 9), (3.3, -8) )
>
>5 write a class derived from both iostream and priority queue? This class
>should be able to handle
>a. take a couple stock objects into stream. (overloads << operator)
>b. when flushing, it will print out to standard output in the order of
>either ticker (a string type) or price (a double type) within the stock
>object. This choice can be set by the user.
>The stock objects are:
>class Stock {
>string ticker;
>double price;
>};
>with {"IBM", 120.0}, {"INTC", 60}, {"AMAT", 75}更多精彩文章及讨论,请光临枫下论坛 rolia.net