Due: Tuesday 10/08 10:00am
Submission name: w13_thermometer0
Write A Processing Program:
Over the next few days, we will be making a processing program to display thermometers, showing temperatures in Fahrenheit and Celsius. This is but phase 0. This program should display a single thermometer made of:
- A large rectangle to contain the entire thermometer.
- A smaller interior rectangle to contain the temperature reading.
- A smaller rectangle containing the actual temperature reading (red part).
- Hashmarks along the side for numbers.
To Start:
Write the following functions, they will be expanded upon in the coming days. For now, assume we are creating a celsius based thermometer from 0 - 100 degrees.
void drawScale(int x, float y, int h)
- Draw the hashmarks along the side of the temperature reading.
- (x, y) should be the left corner of the 0 degree hashmark.
h
should be the height of the entire temperature reading bar.
void drawReading(int x, int y, int w, int h)
- Draw the reading area of the thermometer.
- (x, y) should be the upper left corner of the reading area box.
- w should be the width of the reading area.
- h should be the height of the reading area.
void drawThermometer(int x, int y, int w, int h)
- Draw the entire thermometer, calling
drawScale
anddrawReading
as needed. - (x, y) should be the upper left corner of the entire thermometer.
w
,h
should be the total width and height of the thermometer.- When calling the other functions, make sure that the hash marks and reading area fit within the entire thermometer. You can assume that
h
andw
will always be reasonable enough values to fit everything we need to.
- Draw the entire thermometer, calling
Reference Image:
The reference image includes numbers, you do not need to add them.