Assignment #2

Due Monday October 12, 1998


Use Xlib to implement the following program:

NAME

GoPizza : Group-order Pizza

SYNOPSIS

GoPizza d1 d2 [d3 … dn]

DESCRIPTION

d1, d2, .. dn are display values, e.g., .dew:0.0  The values of n is at least 2 and at most 6. d1 is the "initiator" display, while d2-d6 are invitees displays.

The program creates an "order interface" (see  figure below) on display d1, d2, ...dn. Each person selects
the toppings that he likes and then clicks into the Send button. As soon as a person clicks on the Send button, the interface in each active display reflects the current state (the Count-Down counter is decrement by one and the Total counters of the toppings is incremented accodring to the choices made by that person).

To select a topping, a person clicks into the square beside the topping. In such case, an X is drawn
inside the square. To deselect an item, a person clicks into the corresponding square and in such case
the X is removed from the square.  A person may click on his/her Send button without selecting any of the available toppings. In such case only the Count-Down counter is decrement by one. As soon as a person clicks on his/her Send button, the choice boxes as well as the Send button become insensitive (i.e., they do not respond to any further mouse clicks).

Each person may click on the Quit button to exit from the program at any time (since this  is a serious operation, you should use a dialogue window to confirm or cancel this operation). If the person who quit the program is not the initiator, only his/her interface is removed. The others may continue to use the program
and make thier selection. If the initiator clicks on the Quit button (and confirms this action) the program writes the collected information into a file (call it GoPizza.outpot)  and then terminates. In such case, all interfaces will be removed. Note that a person may quit before or after making his/her selection.

Her is an example of the content of such file:
 

Number of persons invited: 6
Number of persons responded: 4
Mushrooms: 2
Onions: 0
Black Olives: 3
Green Peppers: 2














Back to Assignments Page
Back to CS476/576 Home Page