Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
Lab lecture exercises – 27 November 2015
(This exercise follows Jon Rowe’s implementation in the first year software workshop.)
In week one we learned to know the conversion between degrees Celsius and Fahren-
heit. See, http://www.cs.bham.ac.uk/internal/courses/java/msc/handouts/1-01/
Conversion.java. Today we want to implement a system that uses a ruler and converts
between the two units by following the model-view-controller schema. To this end, we want
to implement seven different classes:
1. Temperature.java, a class with two field variables of type double to represent the
Fahrenheit and the Celsius degrees of a temperature (with a constructor making use
of the Celsius degrees).
2. TemperatureModel.java that extends Observable.
3. SliderListener.java that implements ChangeListener.
4. CelsiusView that extends JLabel and implements Observer.
5. FahrenheitView that extends JLabel and implements Observer.
6. TemperatureComponent that extends JPanel and specifies the details how the ruler
should look like.
7. TemperatureGUI.java containing the main method calling the GUI.
c© 2015, Manfred Kerber, School of Computer Science, University of Birmingham