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
alexdok [17]
2 years ago
15

Zohan uses the following analogy to describe a concept of object-oriented programming. A button can have many uses. When it is p

ressed, it can cause a variety of different outcomes, such as opening a door or changing the volume. But you don't need to know what the button is going to do in order to operate it-you just push it. Which concept is he most likely talking about?
a) polymorphism
b) inheritance
c) encapsulation
d) overriding
​
Computers and Technology
1 answer:
Vika [28.1K]2 years ago
4 0

Answer:

Polymorphism

Explanation:

You can have a basic button class that gets inherited by other classes.

class Button {

function pushButton(){}

}

class ElevatorButton extends Button{};

class BigRedButton extends Button{};

With these new classes, they inherit from the basic button class. They can decide what happens when the method pushButton() is called.

You don't need to worry about what pushButton() actually does, you can just call it if the object is of the type "Button" and you can expect it to work.

You might be interested in
Researchers conducted a 'natural experiment' to examine the effects of on-site food services on weight gain among first-year col
anygoal [31]

Answer:

On-site food services is the INDEPENDENT variable and the weight gain is the DEPENDENT variable

Explanation:

Variables can be dependent or independent. An independent variable is the one used by the researcher to test its degree of influence on the dependent variable. The dependent variable, as the name implies, relies on changes in the independent variable to effect its own changes.

In the question, it is obvious that weight gain among the first year students is dependent on on-site food services

7 0
3 years ago
Apple Final Cut Pro is a digital video editing program that is available for Macs with OS X version 10.4 or later.
aniked [119]
That's actually true lol

3 0
3 years ago
Read 2 more answers
Statement: There are two files. One file, "badIP_list.txt" has a listing of known bad IP addresses. These addresses were extract
lapo4ka [179]

Answer:

See explaination

Explanation:

SOURCE CODE IN PYTHON:

inp=open('badIP_list.txt', 'r') #opening file for input

badIPs=[i.rstrip('\n') for i in inp.readlines()] #reading bad IPs

inp.close() #closing file

inp=open('server_logs.txt', 'r') #opening file for input

IPs=[i.rstrip('\n') for i in inp.readlines()] #reading all IPs from log

inp.close() #closing file

uniqueBadIPs=[] #to store unique bad IPs

countBadIPs=0 #to store count of bad IPs

countIPs=0 #to store count of all IPs

for IP in IPs: #iterating through the log of IPs

if IP in badIPs: #checking if IP is bad

countBadIPs+=1

if IP not in uniqueBadIPs: #checking if bad IP is unique

uniqueBadIPs.append(IP)

countIPs+=1

out=open('filter_list.txt', 'w') #opening file for output

out.write('_________________________________________________________\n')

out.write('Date : 26/07/2018\nName : Last, First\nMajor: CS\n\n')

out.write('Server logs contained these known bad IP addresses:\n')

for IP in uniqueBadIPs: #output the unique bad IPs

out.write(IP+'\n')

out.write('\n')

out.write('Total unique known bad IP\'s detected:\n'+str(len(uniqueBadIPs))+'\n\n')

out.write('Percentage of bad IP addresses in server logs:\n{:.2f}%\n'.format(countBadIPs*100/countIPs))

out.write('_________________________________________________________')

out.close() #closing file

5 0
3 years ago
The theory of continental drift is supported by all of the following EXCEPT
Stels [109]
Climate seems like the correct answer
8 0
3 years ago
A variable like user_num can store a value like an integer. Extend the given program as indicated. Output the user's input. (2 p
lapo4ka [179]

Answer:

The answer to this question is given below in the explanation section. It is noted that this program is written in C++ using online C++ compiler.

Explanation:

#include <iostream>

using namespace std;

int squared(int num)// this is the function to compute square

   {

       return num*num;

   }

int cube(int num)// this is the function to compute cube

   {

       return num*num*num;

   }

int main()

{

   int user_num, user_num2; // variable declaration

   

       cout<<"Enter the first number: ";//prompt user to enter the number

       cin>>user_num;//store the user entered number into variable

       cout<<"\nEnter the second number: ";//prompt the user to enter the second number

       cin>>user_num2;//store the user entered number into variable

   

   

   cout<<"\nSquared of first number is: "<<squared(user_num);//compute square of user_num and display

   cout<<"\nCube of first number is: "<<cube(user_num);//compute the cube of the user_num and display

   cout<<"\nSquare of second number is: "<<squared(user_num2);//compute the square of user_num2 and display

   cout<<"\nCube of second number is: "<<cube(user_num2);//compute the cube of user_num2 and display

   

   cout<<"\nSum of number 1 and number 2 is: "<<user_num2 + user_num2;//display the sum of user_num2 and user_num

   cout<<"\nProduct of number 1 and number 2 is: "<<user_num2 * user_num;//display the product of user_num and user_num2

   

   

   return 0;//terminate the program

}

                               

7 0
3 years ago
Other questions:
  • Write a program that produces a Caesar cipher of a given message string. A Caesar cipher is formed by rotating each letter of a
    14·1 answer
  • What is constructive criticism?
    5·1 answer
  • 5. The coordinates of triangle ABC are A(-7, 3), B(3, -7) and C(8. 8)
    9·2 answers
  • .<br> 1. Press the _______ key to move to the next cell in a row.
    14·2 answers
  • What does the following function return? void index_of_smallest(const double all, int startindex, int numberOfSlots); A. a doubl
    7·1 answer
  • Name three actions you can perform on an inserted image.
    7·2 answers
  • Attackers need a certain amount of information before launching their attack. One common place to find information is to go thro
    11·1 answer
  • Search the link <br><br> gKuJXd3zYDc<br><br> Subscribe I have a vid premiering soon
    11·1 answer
  • Write a function called play_round that simulates two people drawing cards and comparing their values. High card wins. In the ca
    11·1 answer
  • Sigma Technology is a company based in Singapore, with branches in 24 countries. It needs multiple CAs in different locations to
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!