1 CSC111H Client-Server: An Introduction Dennis Burford [email protected].
Test Postmortem Dennis Burford
-
Upload
shon-moody -
Category
Documents
-
view
227 -
download
0
description
Transcript of Test Postmortem Dennis Burford
![Page 2: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/2.jpg)
Question 1a
• Draw a component hierarchy for the following Java application. [5]
![Page 3: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/3.jpg)
Question 1a
JPanel
JPanel
JFrame (with its own content pane)
JPanel
JPanel JPanel
JTextFieldJLabel JTextFieldJLabel
JButtonJButton
JButton
![Page 4: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/4.jpg)
Question 1b
• Name any three of the Layout Managers in Java. [3]
![Page 5: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/5.jpg)
Question 1b
• Name any three of the Layout Managers in Java. [3]
BorderLayout GridLayoutFlowLayout GridBagLayoutBoxLayout
![Page 6: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/6.jpg)
Question 1c
• Give a statement in Java to set the Layout of myPanel to any Layout Manager. [2]
JPanel myPanel = new JPanel();
![Page 7: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/7.jpg)
Question 1c
• Give a statement in Java to set the Layout of myPanel to any Layout Manager. [2]
JPanel myPanel = new JPanel();
myPanel.setLayout( new BorderLayout() );
![Page 8: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/8.jpg)
Question 2a
• You are writing a Swing application and want the program to print out the message “Ouch!” every time you press a button. Show how you would do this for the following button: [4]
JButton button = new JButton(“Press Me”);
![Page 9: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/9.jpg)
Question 2a
button.addActionListener( new ActionListener() { public void actionPerformed( ActionEvent e ){
System.out.println(“Ouch!”);}
}
);
![Page 10: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/10.jpg)
Question 2b
• Indicate what type of Listener is used for each of the following components: [2]
i. JTextfield
ii. JSlider
![Page 11: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/11.jpg)
Question 2b
• Indicate what type of Listener is used for each of the following components: [2]
i. JTextfield ActionListener
ii. JSlider ChangeListener
![Page 12: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/12.jpg)
Question 2c
• What is the difference between a Listener and an Adapter in Java? [2]
![Page 13: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/13.jpg)
Question 2c
• What is the difference between a Listener and an Adapter in Java? [2]
A Listener is an interface (have to implement methods). An Adapter implements a Listener interface using empty methods.
![Page 14: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/14.jpg)
Question 3a
• Name the five stages of the traditional Software Lifecycle. [5]
![Page 15: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/15.jpg)
Question 3a
• Name the five stages of the traditional Software Lifecycle. [5]
1. Specification2. Design3. Implementation4. Testing5. Maintenance
![Page 16: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/16.jpg)
Question 3b
• Give two constraints you would consider when planning a software project. [2]
![Page 17: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/17.jpg)
Question 3b
• Give two constraints you would consider when planning a software project. [2]
Time, Money, Equipment, People,….
![Page 18: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/18.jpg)
Question 4a
• What is the difference between a Milestone and a Deliverable? [2]
![Page 19: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/19.jpg)
Question 4a
• What is the difference between a Milestone and a Deliverable? [2]
A Milestone is the end of a distinct stage. A deliverable is a milestone with tangible results that are delivered to the client.
![Page 20: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/20.jpg)
Question 4b
• Name two commonly used techniques for documenting/illustrating a project schedule.
[2]
![Page 21: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/21.jpg)
Question 4b
• Name two commonly used techniques for documenting/illustrating a project schedule.
[2]
1. Table of Tasks2. Gantt Chart
![Page 22: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/22.jpg)
Question 4c
• Give an example of a common project pitfall (be sure to say what the problem is, rather than just giving a name). [1]
![Page 23: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/23.jpg)
Question 4c
• Give an example of a common project pitfall (be sure to say what the problem is, rather than just giving a name). [1]
One person taking all the responsibility for the project and doing all the work.
(many others….)
![Page 24: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/24.jpg)
Question 5a
• What are the two forms that an IP address can take? Give an example of each (they do not have to be real addresses). [2]
![Page 25: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/25.jpg)
Question 5a
• What are the two forms that an IP address can take? Give an example of each (they do not have to be real addresses). [2]
1. DNS Form: casper2.cs.uct.ac.za2. Dotted Quad Form: 137.158.128.58
![Page 26: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/26.jpg)
Question 5b
• What two things together identify a program offering a service on a machine?
[2]
![Page 27: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/27.jpg)
Question 5b
• What two things together identify a program offering a service on a machine?
[2]
1. IP Address2. Port Number
![Page 28: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/28.jpg)
Question 5c
• Give an example of a type of Internet application that uses the Client-Server model. [1]
![Page 29: Test Postmortem Dennis Burford](https://reader036.fdocuments.net/reader036/viewer/2022062311/5a4d1b6d7f8b9ab0599b3e1e/html5/thumbnails/29.jpg)
Question 5c
• Give an example of a type of Internet application that uses the Client-Server model. [1]
email, web browser, irc, telnet, ftp, ….