Question 1: (40 points)
Consider the program buttonsq.java that creates 12 buttons.
A) Modify the program such that:
- When a button B (B=1..11) is pressed, the program writes the following message to the stdout: Button B is pressed
- When Button 0 is pressed, the program writes the following message to the stdout: Button 0 is pressed: Quitting and then the program terminates.
Solution A: buttonsq1.java
B) Modify the program such that the 12 buttons are arranged as follows:1. Button 1 is placed at the top
2. Button 2 is placed at the left
3. Button 3 is placed at the right
4. Button 0 is placed at the center
5. Buttons 4-11 are arranged into two rows and
four columns and are placed at the button.
Solution B: buttonsq2.java
Consider the following Java Programs:
Rewrite both of these two programs in C using select
(i.e., do NOT use fork or threads).Solution: TwoChatServer.c
Solution: ChatClient.c