1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Digiron [165]
3 years ago
6

You are c# developer who is developing a windows application. you need to provide derived classes the ability to share common fu

nctionality with base classes but still define their own unique behavior. which object-oriented programming concept should you use to accomplish this functionality?
Computers and Technology
1 answer:
ludmilkaskok [199]3 years ago
4 0
Polymorphism; the concept of one definition, but multiple implementations.
In C#, this is done using the 'abstract' and 'override' keywords.
Example:

abstract class Shape {
    public abstract double area();
}

class Square : Shape {
    private double size;

    public Square(double size = 0) {
        this.size = size;
    }

    public override double area() {
        return size * size;
    }
}
You might be interested in
Create a Python program as described below and save it in a file named bool. You should use IDLE or similar environment to creat
Eva8 [605]

PYTHON CODE

# function to compare a and b
def compare(a,b):

    # if a is greater than b , return 1
    if a > b:
        return 1

    # if a and b are equal, return 0
    elif a == b:
        return 0

    # if a less than b , return -1
    elif a < b :
        return -1


# testing
if __name__=="__main__":

    # calling the compare function with a and b
    print('compare(5,2) %d'%compare(5,2))
    print('compare(2,5) %d'%compare(2,5))
    print('compare(3,3) %d'%compare(3,3))

    # getting values for a and b
    a=int(input("Enter the value for a: "))
    b=int(input("Enter the value for b: "))

    print('compare(%d,%d) %d'%(a,b,compare(a,b)))

(see attachment for output)

8 0
3 years ago
Besides technical skill, what is the most important factor for staying employed and being offered promotions?
Natali [406]

Obtaining a college degree= while this is nice, you can get a lot of placed with just a GED or Highschool Degree

pursuing self-directed learning=this will help you

showing professional behavior= yes this helps a lot

setting long-term goals= this could help you in the end game

Overall, i think it would be between B and C, though C sounds correct over B because even if you pursue self directed learning, you could still get fired or quit or not get a promotion.

3 0
3 years ago
Read 2 more answers
This is for C++: Using a nested for loop output the following pattern to the screen:
olga55 [171]

Answer:

Following are the code to the given question:

#include <iostream>//header file

using namespace std;

int main()//main method

{

int r=26,x,y;//defining integer variable  

char c;//defining a character variable

for(x= 1; y<= r; x++)//using for loop for count value

{

for(y= 1; y<= x; y++)//using for loop to convert value in triangle  

{

c=(char)(y+64);//convert value into character  

cout << c;//print character value

}

cout << "\n";//use print method for line break

}

return 0;

}

Output:

Please find the attachment file.

Explanation:

In this code, three integer variable "x,y, and r", and one character variable "c" is declared, that is used in the nested for loop,  in the first for loop it counts the character value and in the next for loop, it converts the value into a triangle and uses the char variable to print its character value.

3 0
2 years ago
To save a file so that it can be opened on most computers, select the _____ option.
romanna [79]
Save it on the cloud.
6 0
3 years ago
Read 2 more answers
In Java an abstract class cannot be sub-classed<br><br> ?? True<br><br> ?? False
mojhsa [17]

Answer:

False

Explanation:

An abstract class is a class declared abstract — it may or may not include abstract techniques. It is not possible to instantiate abstract classes, but they can be sub-classed.

<u></u>

<u>Abstract method declaration</u>

             

         abstract void moveTo(double X, double Y);

Usually the subclass offers solutions for all of the abstract techniques in its parent class when an abstract class is sub-classed. If not, however, the subclass must be declared abstract as well.

<u>Example</u>

public abstract class GraphicObject {

  // declaring fields

  // declaring non-abstract methods

  abstract void draw();

}

8 0
3 years ago
Other questions:
  • Where does the oracle11g server store information about objects in the database, including information about constraints?
    15·1 answer
  • Anna always has a hard time finding files on her computer because she does not know where she saved them. This also affects her
    12·2 answers
  • If you are driving at night, you should not use high-beam headlights within _________ of oncoming vehicles. Florida Road Rules 4
    9·2 answers
  • A number of LC-3 instructions have an "evaluate address" step in the instruction cycle, in which a 16-bit address is constructed
    6·1 answer
  • Which of the following statements is TRUE of the information systems (IS) department? A. The operations group monitors user expe
    8·1 answer
  • A form letter can be customized by using different fields in a __________.
    15·2 answers
  • Please write a Java program to read movies.txt file. (It is in Modules under Chapter Code) Create your own movies.ser file from
    14·1 answer
  • Cloud architects have been largely replaced by ScrumMasters.<br><br> True<br><br> False
    15·2 answers
  • Leslie works in an SDLC team. When Leslie edits a file, it gets saved as an altered version. Later all the altered versions are
    9·1 answer
  • What is the difference between php and html?​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!