Java questions - I need the answers
Declare each of the following:
(a) a field of data type boolean and name isFound;
(b) a local variable of data type String and name carModel;
(c) a field of data type double and name weight;
(d) a field of data type Employee and name secretary.
2. Write a declaration for an array variable temperatures that could be used to refer
to an array of double values.
Give a Java statement to create an array of double elements of size 95 and referenced
by temperatures.
What is the index range for this array?
Write a fragment of code to determine the average temperature in an array, temperatures,
of temperature readings.
3. A class Car has the following fields:
private String registration;
private int doors;
private String colour;
private CarDealer supplier;
(a) Define a class variable, totalCars, whose purpose is to keep track of the total
number of Car objects constructed during execution of a program that uses
the Car class.
(b) Declare a default constructor for this class.
(c) Declare a constructor for this class which has a formal parameter corresponding
to each field.
(d) Declare an accessor method called getColour whose purpose is to return the
value of the colour field of this Car.
(e) Declare a mutator method that sets the registration number of this Car to a
given value.
(f) Declare a method to determine whether this Car has a given colour.