✍ ️Get Free Writing Help
WhatsApp

Problem 1 Which object-oriented principle does the following description most closely describe.


Problem 1

Which object-oriented principle does the following description most closely describe.

There should never be more than one reason for a class to change.

Single Responsibility Principle

Open/Close Principle

Liskov Substitutability Principle

Interface Segregation Principle

Dependency Inversion Principle

Don’t Repeat Yourself

 

Problem 2

Problem 2

Which object-oriented principle does the following description most closely describe.

You should make all member variables private by default. Write getters and setters only when you need them.

Single Responsibility Principle

Open/Close Principle

Liskov Substitutability Principle

Interface Segregation Principle

Dependency Inversion Principle

Don’t Repeat Yourself

 

Problem 3

Problem 3

Which object-oriented principle does the following description most closely describe.

Objects in a program should be replaceable with instances of their subtypes without altering the correctness of the program.

Single Responsibility Principle

Open/Close Principle

Liskov Substitutability Principle

Interface Segregation Principle

Dependency Inversion Principle

Don’t Repeat Yourself

 

Problem 4

Problem 4

Which object-oriented principle does the following description most closely describe.

You should not have to implement methods that you don’t use.

Single Responsibility Principle

Open/Close Principle

Liskov Substitutability Principle

Interface Segregation Principle

Dependency Inversion Principle

Don’t Repeat Yourself

 

Problem 5

Problem 5

Which object-oriented principle does the following description most closely describe.

Don’t add concrete classes to method signatures of an interface. However, use interfaces in your class methods.

Single Responsibility Principle

Open/Close Principle

Liskov Substitutability Principle

Interface Segregation Principle

Dependency Inversion Principle

Don’t Repeat Yourself

 

Problem 6

Problem 6

Which object-oriented principle does the following description most closely describe.

Duplication in logic should be eliminated via abstraction; duplication in process should be eliminated via automation.

Single Responsibility Principle

Open/Close Principle

Liskov Substitutability Principle

Interface Segregation Principle

Dependency Inversion Principle

Don’t Repeat Yourself

 

Problem 7

Problem 7

Describe in a few sentences what a linked-list is, how it works, advantages, and disadvantages, and performance/efficiency.

 

Problem 8

Problem 8

In a few sentences, describe the difference between a stack and a queue.

 

Problem 9

Problem 9

Which algorithm does the following pseudocode describe?

Algorithm

Procedure Mystery(DATA : list of sortable items)

N= DATA.Length

1.       Set Flag := True

2.       Repeat Steps  from 3 to 5 for I = 1 to N-1 while Flag == true

3.       Set Flag := False

4.       Set J:=0. [Initialize pass pointer J]

5.       Repeat while J<N-1 [Executes pass]

(a)     If DATA[J+1]>DATA[J], then:

Swap DATA[J] and DATA[J+1]

Set Flag:= True

[End of If structure]

(b)   Set J:=J+1

[End of inner loop]

[End of step 1 outer loop]

6. Exit

Bubble Sort

Insertion Sort

Shell Sort

Heap Sort

 

Problem 10

Problem 10

What is the space complexity of Bubble Sort?

O(n)

(n log n)

O(n2)

O(n!)

 

Problem 11

Problem 11

What is the worst case performance of Insertion Sort?

O(n2)

O(n)

O(n/2)

O(n log n)

 

Problem 12

Problem 12

Describe what a C# Stream is and what it’s used for.

 

Problem 13

Problem 13

Describe what an Abstract Data Type is in the context of a data structure.

 

Problem 14

Problem 14

Write a program that reads N integers from the console and reverses them using a stack.  Use the Stack  class.  Use a character as the sentinel character for stopping the collection of ints during input.

Upload your Main() class or any other code that you have written to accomplish this task.

This Problem was imported from an external source. It was a ‘File Upload’ Problem, which is not supported in this quiz tool.

 

Problem 15

Problem 15

Implement a program that reads a set of integers from a text file and stores them in a List.  Test with a file containing at least 20 integers.

Implement the Improved Bubble Sort algorithm to sort the List that you read from the file.

Output the pre-sorted and post-sorted integers to the console.

Submit your code file(s).  If you have more than one class, zip up the files before submission.

This Problem was imported from an external source. It was a ‘File Upload’ Problem, which is not supported in this quiz tool.

The post Problem 1 Which object-oriented principle does the following description most closely describe. appeared first on PapersSpot.

Don`t copy text!