User Profile
Collapse
-
Wont I need to declare more things in my contructor and instance variables if I am going to compare more than one temperature? -
...Code:public class Temp { double temperature = 0; String Scale = " "; /** * Constructor for objects of class Temp */ public Temp(double x,String b) { temperature = x; Scale = "a"; } public Temp() { temperature = 0; Scale = " "; } public doubleLeave a comment:
-
Extremely Confusing Prompt from instructor.
So my teacher wants us to write the following program:
"2. Write a Temperature class that has two instance variables: a temperature value ( a floating-point number) and a character for the scale, either C for Celsius or F for Fahrenheit. The class should have four constructor methods: one for each instance variable (assume zero degree if no value is specified and Celsius if no scale is specified), one with two parameters for the two...
No activity results to display
Show More
Leave a comment: