This is the program we were assigned to do In JAVA - please i need the complete
ID: 3573026 • Letter: T
Question
This is the program we were assigned to do In JAVA
- please i need the complete code.
(Project: Emergency Response Class) The North American emergency response service, 9-1-1, connects callers to a local Public Service Answering Point (PSAP). Traditionally, the PSAP would ask the caller for identification information—including the caller’s address, phone number and the nature of the emergency, then dispatch the appropriate emergency responders (such as the police, an ambulance or the fire department). Enhanced 9-1-1 (or E9-1-1) uses computers and databases to determine the caller’s physical address, directs the call to the nearest PSAP, and displays the caller’s phone number and address to the call taker. Wireless Enhanced 9-1-1 provides call takers with identification information for wireless calls. Rolled out in two phases, the first phase required carriers to provide the wireless phone number and the location of the cell site or base station transmitting the call. The second phase required carriers to provide the location of the caller (using technologies such as GPS). To learn more about 9-1-1, visit www.fcc.gov/pshs/services/911-services/Welcome.html and people.howstuffworks.com/9-1-1.htm.
An important part of creating a class is determining the class’s attributes (instance variables). For this class design exercise, research 9-1-1 services on the Internet. Then, design a class called Emergency that might be used in an object-oriented 9-1-1 emergency response system. List the attributes that an object of this class might use to represent the emergency. For example, the class might include information on who reported the emergency (including their phone number), the location of the emergency, the time of the report, the nature of the emergency, the type of response and the status of the response. The class attributes should completely describe the nature of the problem and what’s happening to resolve that problem.
Explanation / Answer
public class ResponseTeam {
public static void main(String[] args){
Emergency e = new Emergency();
e.init("John Wick", 223322, "My car stolen");
}
}
class Emergency{
//this will explain type of emergency help needed
public static enum TYPE{
FIRE, MEDICAL, ENFORCER
};
//current progress status of emergency
public static enum STATUS{
CALLING_FORCE, CALLED_FORCE, RESPONSE_REACHED, RESOLVED
}
//caller name, number, location, time and description
String callerName;
int callerNumber;
String location;
Long time;
String description;
//Emergency Type sent
Emergency.TYPE callerType;
//help progress
Emergency.STATUS forceStatus;
//does the request even responded till now?
boolean responded;
Emergency(){
this.time = System.nanoTime();
this.callerType = TYPE.ENFORCER;
this.location = getGPS();
}
void init(String name, int number, String description){
this.callerName = name;
this.callerNumber = number;
this.description = description;
}
String getGPS(){
return "simulate GPS";
}
public String getCallerName() {
return callerName;
}
public void setCallerName(String callerName) {
this.callerName = callerName;
}
public int getCallerNumber() {
return callerNumber;
}
public void setCallerNumber(int callerNumber) {
this.callerNumber = callerNumber;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public Long getTime() {
return time;
}
public void setTime(Long time) {
this.time = time;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public TYPE getCallerType() {
return callerType;
}
public void setCallerType(TYPE callerType) {
this.callerType = callerType;
}
public STATUS getForceStatus() {
return forceStatus;
}
public void setForceStatus(STATUS forceStatus) {
this.forceStatus = forceStatus;
}
public boolean isResponded() {
return responded;
}
public void setResponded(boolean responded) {
this.responded = responded;
}
}
----------------
Hastebin link in case code gets unformatted: http://www.hastebin.com/ayovokubip.java
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.