Question
QUESTION 14 MVC stands for Model-View-Controller, a design pattern that separates program tasks into different tiers. True False 2 points QUESTION 15 The following Javascript
QUESTION 14 MVC stands for Model-View-Controller, a design pattern that separates program tasks into different tiers. True False 2 points
QUESTION 15 The following Javascript code is most likely in which tier of the Model-View-Controller design pattern? function calculate(){ var r = parseFloat(document.getElementById('radius').value); // Check for nonnumeric data if(isNaN(r)){ document.getElementById('data').innerHTML = "Please enter numbers only"; return; } // Check for negative data if(r<=0){ document.getElementById('data').innerHTML = "Negative numbers don't make sense"; return; } // Data is good var myCircle = new Circle(r); document.getElementById('data').innerHTML = myCircle.getData(); } Model View Controller Unable to determine 2 points
QUESTION 16 Using the concept of dynamic method invocation, where would the program first look for a method? The current class The superclass The root class The program must explicitly state which class to check first 2 points
QUESTION 17 Which of the following is an example of instantiation? public static void main(String[] args) Rectangle rect1 = new Rectangle(); rect1.length = 4.0; rect1.width = 2.0; System.out.println(rect1.length + x + rect1.width); 2 points
QUESTION 18 nar001-1.jpg Given the UML class diagram seen in the accompanying figure, what is/are the classs member method(s)? Rectangle length and width getArea and getPerimeter Unknown 2 points
QUESTION 19 In C#, Java, and Objective-C, what is the greatest number of subclasses a class can have? Depends on the language 0 1 More than 1 2 points
QUESTION 20 In the following code, which lines make up the constructor(s)? 0 public class Bus { 1 private BankAccount ba; 2 private double fuelLeft; 3 private final double FUEL_MAX = 40.0; 4 private final double FUEL_COST = 3.54; 5 public Bus(BankAccount baRef) { 6 fuelLeft = 0; 7 ba = baRef; 8 } 9 public void fillTank() { 10 double cost = (FUEL_MAX - fuelLeft) * FUEL_COST; 11 if (ba.pay(cost) == true) { 12 fuelLeft = FUEL_MAX; 13 } 14 } 15 public double getFuelLeft() { 16 return fuelLeft; 17 } 18 } Lines 1-4 Lines 5-8 Lines 1-8 Lines 0-18 2 points QUESTION 21 Which language(s) use(s) the this keyword as a metaphor to refer to the current object within that objects context? C# only Java only C# and Java C#, Java, Objective-C 2 points
QUESTION 22 Which Java keyword indicates the inheritance relationship? inherits imports uses extends 2 points
QUESTION 23 Which is not a possible outcome of an app with a memory leak? The app will run without issue. The app will close itself automatically when it reaches the memory limit. The app will crash. The system will crash. 2 points
QUESTION 24 Which of the following is the best example of encapsulation? A main function doing error-checking before setting a Rectangles instance variables values. A Rectangle having two instance variables: width and length. A Rectangle object displaying its own data onscreen. A Rectangle object setting its height value.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started