Question

1. (TCO 7) Which of the following statements are true? (Points : 5)        Interfaces contain...

1. (TCO 7) Which of the following statements are true? (Points : 5)        Interfaces contain one and only one implemented method, a constructor.
       Interfaces are defined inside an abstract class.
       All methods defined in an interface must be implemented when used by another class.
       A true object-oriented design must contain as least one interface.

Question 2. 2. (TCO 7) In an object-oriented program, methods with no implementation might be found in an _____ and/or a(n) ______. (Points : 5)
       abstract class; base class
       abstract class; interface
       interface; base class
       None of the above
Question 3. 3. (TCO 7) When developing an object-oriented application, developers are required to comply with specific _____ or rules defined in a framework. (Points : 5)
       programming styles
       object hierarchies
       instantiated classes
       contracts
       None of the above
Question 4. 4. (TCO 8) Data/information hiding and encapsulation improves construction and maintenance because: (Points : 5)
       A. Program bugs are isolated to a single class.
       B. Programming to an interface makes the code more logical.
       Both A and B
       None of the above
Question 5. 5. (TCO 8) What are some of the characteristics of a “good” comment? (Points : 5)
       Detailed comments should address all aspects of the code and structure
       Code markers should be used to show what the developer still needs to do
       Comments showing the intent of the code
       All of the above
       None of the above
Question 6. 6. (TCO 9) Which of the following allow a programmer to reduce the complexity of an object-oriented program? (Points : 5)
       Create each class in a separate file
       Using namespaces as a container for logically related items
       Using namespaces to create global types
       All of the above
       None of the above
Question 7. 7. (TCO 1) Assuming a class definition of a Bear that has a default constructor and constructor that accepts three string arguments, and the appropriate properties defined, how many objects are created in the code below?

static void Main(string[] args)
{
   Bear newObject;
   Bear newBearObject = new Bear();
   Bear newBear = new Bear("Bear", "Yogi", "Polar");
   Bear newBigBear = new Bear(); ;

   newObject = newBearObject;
}

(Points : 5)
       2
       3
       5
       4
Question 8. 8. (TCO 2) Given a private attribute called favoriteColor, which of the following are proper implementations for a getter and a setter? (Points : 5)
       int GetFavoriteColor(){return favoriteColor;}, int SetFavoriteColor(int favoriteColor){return favoriteColor;}
       void GetFavoriteColor (){return favoriteColor;}, void SetFavoriteColor (int favoriteColor){this.favoriteColor = favoriteColor;}
       string GetFavoriteColor (){return favoriteColor;}, void SetFavoriteColor (string favoriteColor){this.favoriteColor = favoriteColor;}
       string GetFavoriteColor (){this.favoriteColor = favoriteColor;}, void SetFavoriteColor (string favoriteColor){return favoriteColor;}
Question 9. 9. (TCO 7) Which of the following declares an abstract method in an abstract class? (Points : 5)

       public abstract void DisplayResult();
       public void abstract DisplayResult();
       public void DisplayResult{};
       public abstract void DisplayResult() {}

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
1. (TCO 7) Which of the following statements are true? (Points : 5)        Interfaces contain...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Abstract classes and Interfaces problems 10. Explain one similarity and one difference between ab...

    Abstract classes and Interfaces problems 10. Explain one similarity and one difference between abstract classes and interfaces. 11. Consider the following declarations. public interface Shape{ int someFunction(Shape other); //other functions not shown } public class Square implements Shape {/*implementation not shown*/} Which of the following function headings of someFunction must be added to the declaration of the Square class such that it will satisfy the Shape interface? public int someFunction (Shape other) public int someFunction (Square other) public boolean someFunction(Object...

  • Abstract classes and Interfaces problems 10. Explain one similarity and one difference between abstract classes and...

    Abstract classes and Interfaces problems 10. Explain one similarity and one difference between abstract classes and interfaces. 11. Consider the following declarations. public interface Shape{ int someFunction(Shape other); //other functions not shown } public class Square implements Shape {/*implementation not shown*/} Which of the following function headings of someFunction must be added to the declaration of the Square class such that it will satisfy the Shape interface? public int someFunction (Shape other) public int someFunction (Square other) public boolean someFunction(Object...

  • In this lab you will work with abstract classes/interfaces. (Java Program) You will be implementing a...

    In this lab you will work with abstract classes/interfaces. (Java Program) You will be implementing a basic employee schema within a company. The Employee class will be an abstract class that will contain methods applicable to all employees. You will then create 2 classes called SoftwareEngineer and ProductManager. Both are different employee types based on occupation. You will create an interface called Developer which will consist of specific methods that apply to only Developers (e.g. SoftwareEngineer class will implement this,...

  • Rewrite the Course class in Listing 10.6 to implement the comparable and the cloneable interfaces. The...

    Rewrite the Course class in Listing 10.6 to implement the comparable and the cloneable interfaces. The clone method must allow a deep copy on the students field. In addition, add the equals(Object o) and the toString() methods. Write a test program to invoke the compareTo, clone, equals, and toString methods in a meaningful way. Below is the Listing from the book that needs to be rewritten public class Course {    private String courseName;    private String[] students = new...

  • Question 1 1 pts Which of the following is not a valid class name in Java?...

    Question 1 1 pts Which of the following is not a valid class name in Java? O MyClass MyClass1 My_Class MyClass# Question 2 1 pts Which of the following statements is False about instance variables and methods? Instance variables are usually defined with private access modifier. Instance variables are defined inside instance methods. Instance methods are invoked on an object of the class that contains the methods. A class can have more than one instance variables and methods. Question 3...

  • Java program. Code the following interfaces, implement them, and use the interface as a parameter, respectively:...

    Java program. Code the following interfaces, implement them, and use the interface as a parameter, respectively: a. An interface called Printable with a void print() method. b. An interface called EmployeeType with FACULTY and CLASSIFIED integer data. The value of FACULTY is 1 and CLASSIFIED is 2. a. A class called Employee to implement the two interfaces. Its constructor will initialize three instance data as name, employeeType, and salary. Implementation of method print() will display name, employeeType, and salary; salary...

  • Assignment4: Evaluate Arithmetic Expressions. Requirements: Implement a concrete ArrayStack class that extends the IStack interface as...

    Assignment4: Evaluate Arithmetic Expressions. Requirements: Implement a concrete ArrayStack class that extends the IStack interface as we discussed in the class (any other different Stack class implementation, even if it is implemented by yourself, will not receive any credit). Write a test class called Evaluate and a method that evaluates an arithmatic expression, which is given by a string. import java.util.Scanner; public class Evaluate { public static void main(String[] args) } // your implementation // obtain user's input from keyboard...

  • Java Code the following interfaces - An interface called Accountable with void withdraw(double) and double getBalance()...

    Java Code the following interfaces - An interface called Accountable with void withdraw(double) and double getBalance() methods, and an interface called AccountReceivable with a void deposit(double) method. Save these two interfaces in separate Java files. Then code a class, BusinessAccount, that implements the two interfaces defined above. Define and code the necessary instance variables and constructors. Override toString() so it will return the amount of a business account. Apply the particular operations, such as withdraw and deposit, required in implementing...

  • 1. (TCO 1) What is the output of the following C++ code? int list[5] = {0,...

    1. (TCO 1) What is the output of the following C++ code? int list[5] = {0, 5, 10, 15, 20}; int j; for (j = 0; j < 5; j++)      cout << list[j]; (Points : 4)         0 1 2 3 4         0 5 10 15         0 5 10 15 20         5 10 15 20 Question 2.2. (TCO 1) What is stored in alpha after the following code executes? int alpha[5] = {0}; int j; for (j = 0; j...

  • Question 1 (5 points) Question 1 Unsaved What is displayed on the console when running the...

    Question 1 (5 points) Question 1 Unsaved What is displayed on the console when running the following program? public class Quiz2B { public static void main(String[] args) { try { System.out.println("Welcome to Java"); int i = 0; int y = 2 / i; System.out.println("Welcome to Java"); } catch (RuntimeException ex) { System.out.println("Welcome to Java"); } finally { System.out.println("End of the block"); } } } Question 1 options: The program displays Welcome to Java two times. The program displays Welcome to...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT