2023 COSC 1436 EL Centro Week 15 Cell Phone Class | Assignment Collections

Computer Science 2023 Java

2023 COSC 1436 EL Centro Week 15 Cell Phone Class | Assignment Collections





/**

* COSC 1436

* EL Centro

* Week 15

* Cell Phone Class

*

* This CLASS does not need to change

*

*/

import java.util.ArrayList;

import java.util.Arrays;



public class CellPhone {

// Attributes

private final ArrayList<String> AVAILABLE_BATTERY_TYPES = new ArrayList<>(

Arrays.asList("NiCd", "NiMH", "Lo-ion", "Li-pol"));

private ArrayList<Long> favoritePhoneNumbers = new ArrayList<Long>();



private String cellProvider = "AT&T";

private String batteryType = null;

private boolean isFlipPhone = false;

private boolean hasInternational = false;



// Methods

public ArrayList<Long> getFavoritePhoneNumbers() {

return favoritePhoneNumbers;

}



public void addAFavoritePhoneNumber(Long phoneNumber) {

this.favoritePhoneNumbers.add(phoneNumber);

}



public void deleteAFavoritePhoneNumber(int phoneNumber) {

this.favoritePhoneNumbers.remove(phoneNumber);

}



public String getCellProvider() {

return cellProvider;

}



public void setCellProvider(String cellProvider) {

this.cellProvider = cellProvider;

}



public String getBatteryType() {

return batteryType;

}



/**

* Validates battery type

* @param batteryType

* @return

*/

public boolean setBatteryType(String batteryType) {

if (AVAILABLE_BATTERY_TYPES.contains(batteryType)) {

this.batteryType = batteryType;

return true;

}

return false;

}



public boolean isFlipPhone() {

return isFlipPhone;

}



public void setFlipPhone(boolean isFlipPhone) {

this.isFlipPhone = isFlipPhone;

}



public boolean isHasInternational() {

return hasInternational;

}



public void setHasInternational(boolean hasInternational) {

this.hasInternational = hasInternational;

}



public ArrayList<String> getAVAILABLE_BATTERY_TYPES() {

return AVAILABLE_BATTERY_TYPES;

}



public boolean isValidBatteryType() {

return batteryType != null;

}



@Override

public String toString() {

StringBuilder builder = new StringBuilder();

builder.append("CellPhone [favoritePhoneNumbers=");

builder.append(favoritePhoneNumbers);

builder.append(", cellProvider=");

builder.append(cellProvider);

builder.append(", batteryType=");

builder.append(batteryType);

builder.append(", isFlipPhone=");

builder.append(isFlipPhone);

builder.append(", hasInternational=");

builder.append(hasInternational);

builder.append(", valid battery type=");

builder.append(isValidBatteryType());

builder.append("]");

return builder.toString();

}



}

Create a new Java Project for this assignment.

       Copy the provided class CellPhone into your default package area.

  1. Create a new class called SmartPhone that extends CellPhone. Add the following attributes:

    1. boolean – hasGPS. 
    2. boolean – hasWIFI. 
    3. String OSVersion.   Default to “Windows 10 Mobile”;
    4. long internalMemoryStorageCapacity – Default to 16_000_000_000L;
    5. Generate the setters and getters and toString() method.
  2. Create a new class called TestPhone that includes a main() method.
  3. Inside the main() method of TestPhone, do the following: 
    1. Create an instance of CellPhone. Set all the following attributes to values of your choosing: (Call all the setters with values) 
      1. cell provider
      2. isFlipPhone
      3. hasInternational
      4. batteryType
      5. Add 2 favorite phone numbers
    2. Display the CellPhone toString results.
    3. Create an instance of SmartPhone. Set the following attributes to values of your choosing: 
      1. hasGPS
      2. hasWIFI
      3. OSVersion 
      4. cell Provider
      5. isFlipPhone
      6. hasInternational
      7. batteryType
      8. Add 1 favorite phone number
    4. Display the SmartPhone toString results.

Deliverables include the SmartPhone.java and TestPhone.java files.

There is no defined constructors in the CellPhone class so the super() method does not need to be addressed.

 

We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.

Place Order Now

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational