Question: * * Template Developed by Sotirios Liaskos for the needs of * ITEC 3 0 3 0 Systems Architecture. * @ All Rights Reserved *

*
* Template Developed by Sotirios Liaskos for the needs of
* ITEC3030 Systems Architecture.
* @ All Rights Reserved
*/
package itec3030.assignments.a1;
import java.util.ArrayList;
import itec3030.smarthome.standards.*;
/**
* A Room object for maintaining room information.
* @author Sotirios
*/
public class Room {
private String name = "default";
private ArrayList<___________> tempSensors = new ArrayList<>();
/**
* The name of the Room (e.g. Living Room)
* @return The name of the room
*/
public String getName(){
return name;
}
/**
* The name of the Room (e.g. Living Room)
* @param name The name of the room.
*/
public void setName(String name){
this.name = name;
}
//
// ROOM SETUP
//
/**
* Use this function to install a temperature sensor to the room.
* @param t Reference to an object that implements [xxx].
*/
public void install(___________ t){
tempSensors.add(t);
}
//
// OFFER ROOM INFORMATION
//
/**
* Returns the average temperature readings of the sensors installed in the room.
* @return The average temperature of the room according to the sensors installed in it.
*/
public float getAvergeTemperature(){
float count =0;
float sum =0;
for (___________ s : tempSensors){
sum += s.getReading();
count++;
}
return(float)(sum/count);
}
/**
* Returns true if an object implementing a [xxx] interface is found in the room.
* @param s Reference to an object that implements [xxx].
* @return True if the object is installed in the room. Currently checks only the collection of temperature sensors.
*/
public boolean hasThing(___________ s){
boolean found = false;
for (___________ t : tempSensors){
if (t.equals(s)) found = true;
}
// Collection of other types can be added here.
return (found);
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!