subject

Here is an outline for a working class OldCellPhone that has no errors (you may see this exact class several times in this exam):class OldCellPhone{ static public final int MIN_CAP = 10; static public final int MAX_CAP = 1000; static public final String DEFAULT_DSCR = "(generic phone)"; private String description; private int memCapacity; private boolean camera; private boolean gps; public void setCamera( boolean hasCam ) { camera = hasCam; } public void setGps( boolean hasGps ) { gps = hasGps; } public OldCellPhone() { this(DEFAULT_DSCR, MIN_CAP, false, false); } public OldCellPhone(String dscr, int mem, boolean cam, boolean gp) { // not shown } public String toString() { // not shown } public boolean setMemCapacity(int mem) { // not shown }};A programmer decides to make the static DEFAULT_DSCR mutable, removing its final status, as in: static public String DEFAULT_DSCR = "(generic phone)";A mutator is added for this member. Any String whose length is at least 2 characters will be acceptable as a new DEFAULT_DSCR. Check the true statements (there may be more than one correct answer):A. If the mutator takes a String parameter, newDefault, a reasonable definition would be: if ( newDefault. length() < 2 ) { this. newDefault = DEFAULT_DSCR; return false; } this. newDefault = newDefault; return true;B. If the mutator takes a String parameter, newDefault, a reasonable definition would be: if ( newDefault. length() < 2 ) return false; DEFAULT_DSCR = newDefault; return true;C. The mutator for this member will be an instance method. D. If the mutator takes a String parameter, newDefault, a reasonable definition would be: if ( newDefault. length() > 0 ) return false; DEFAULT_DSCR = newDefault; return true;E. The mutator for this member will be a static method.2.Consider the class as partially defined here://class PizzaOrder class PizzaOrder{ // static public members public static final int MAX_TOPPINGS = 20; // instance members private String toppings[]; private int numToppings; // constructor public PizzaOrder() { numToppings = 0; toppings = new String[MAX_TOPPINGS]; } // accessor tells # toppings on pizza, i. e., #toppings in array public int getNumToppings() { return numToppings; } // etc.}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:10
Read the code below. what will the computer print if the input for year_variable is 1700? if year_variable == 1776: print("your answer is correct. the declaration of independence was signed in “year_variable”.") elif year_variable < 1776: compute_variable = 1776 - year_variable. print("add “compute_variable“ years to your answer for the correct answer.") elif year_variable > 1776: compute_variable = year_variable - 1776 print("subtract “compute_variable” years from your answer for the correct answer.")
Answers: 1
question
Computers and Technology, 22.06.2019 16:10
When copying and pasting text, the first step is move your cursor type the text select the copy command select the paste command
Answers: 2
question
Computers and Technology, 23.06.2019 06:00
Which statistical function in a spreadsheet you to see how far each number varies, on average, from the average value of the list?
Answers: 2
question
Computers and Technology, 24.06.2019 10:00
(, urgent need): how do i change my username
Answers: 1
You know the right answer?
Here is an outline for a working class OldCellPhone that has no errors (you may see this exact class...
Questions
question
Mathematics, 12.05.2021 03:00
question
Mathematics, 12.05.2021 03:00
question
Mathematics, 12.05.2021 03:00