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
frez [133]
3 years ago
8

In object-oriented programming, ________ allows a new class to automatically use all the data and methods of its parent class.

Computers and Technology
1 answer:
Rudik [331]3 years ago
4 0
Answer: Inheritance

Explanation enables a new object to be defined in object oriented programming so that it inherits the attributes that were previously defined in another object (called the parent object).

A class defines an object in terms of its attributes (properties), and methods that are used to operate on the object.

Example:
An object defined as "human being" may have defined to have attributes that are common to all human beings such as gender, age, height, and intelligence quotient.
Methods for this object may include "eats nutritional meals", "drinks moderately", "is married", and so on.

Another object could be defined as "a cancer patient" who inherits the properties of a "human being" as well as the methods that apply to a "human being". However, the new object has additional attributes such as "is prone to infection", "needs chemotherapy", and so on. It may also define new methods that describe how the disease is being treated.

You might be interested in
Consider a file system that uses inodes to represent files. Disk blocks are 8KB in size, and a pointer to a disk block requires
insens350 [35]

Answer:

64 terabytes

Explanation:

Given data:

Size of the disk block = 8 KB

Size required by the pointer to a disk block = 4 bytes

Now,

Size required by 12 direct disk blocks = 12 × 8

Size required by single disk block = 2048 × 8 KB

Size required by double disk block = 2048 × 2048 × 8 KB

size  required by triple disk block = 2048 × 2048 × 2048 × 8 KB

Now,

the maximum size of the file that can be stored in the this file system = 12 × 8  + 2048 × 8 KB  +  2048 × 2048 × 8 KB + 2048 × 2048 × 2048 × 8 KB  = 64 terabytes

5 0
4 years ago
What is the perpose of the boolean variable swaps in this buble sort algorithm
inn [45]

Answer:

“Bubble Up” algorithm will move largest

value to its correct location (to the

right/end of array)

• Repeat “Bubble Up” until all elements are

correctly placed:

– Maximum of N-1 times

– Can finish early if no swapping occurs

• We reduce the number of elements we

compare each time one is correctly placed

7 0
3 years ago
Team ordering You have the results of a completed round-robin tournament in which n teams played each other once. Each game ende
julia-pushkina [17]

Answer:

Following are the analogies to this question:

Explanation:

In each match, the group is a comparison because there may be a tie situation, which already implies, that its triage was unabated, 1 means the best team, and n means the worst team.

It makes it much easier to address whether another 'Quick Sort' or even the 'Merge Sort' issue by converting the very same problem throughout the number problem.

All the cases use for the Merge Sort, in which it utilizes its evenly divide or overcome strategy where the category is reciprocally divided into two parts where the number becomes measured at n==2, and the outcome extends.

Assume we get 7 squads:

2 4 5 4 3 1 6

Recursively split the above teams:

2 4 5 4 3 1 6

2 4 5 4 3 1 6

We'll equate such figures with base-case (n==2) (have a match against each other)

2 4 4 5 1 3 6 (number of matches 1(2,4) + 1(5,4) + 1(3,1) = 3)

Now the division is combined.

1, 2 ,3, 4, 4, 5

NLogN was its best time complexity of an algorithm but N is the lot of clubs.

7 0
3 years ago
For each of the following six program fragments: a) Give an analysis of the running time (Big-Oh will do). b) Implement the code
lions [1.4K]

Answer:

1) no of computations are :

sum =0 - (1 time )

i=0 ( 1 times)

i<n ( n times )

++sum(n times)

++i (n times)

Total = 3n+2

O(n) is the big O notation

2) no of computations are :

sum =0 - (1 time )

i=0 ( 1 times)

i<n ( n times )

++sum(n^2 times)

++i (n times)

j=0 ( n times)

j<n (n^2 times)

++j (n^2 times)

Total = 3n^2 + 3n+2

O(n^2) is the big O notation as we considered the maximum possible computation

3) no of computations are :

sum =0 - (1 time )

i=0 ( 1 times)

i<n ( n times )

++sum(n^3 times)

++i (n times)

j=0 ( n times)

j<n (n^3 times)

++j (n^3 times)

Total = 3n^3 + 3n+2

O(n^3) is the big O notation as we considered the maximum possible computation

4) no of computations are :

sum =0 - (1 time )

i=0 ( 1 times)

i<n ( n times )

++i (n times)

In the "j" th loop

j=0 ( n times)

j<i (this executes for max of n^2 times when i=n-1)

Similarly ++j (n^2 times when i=n-1)

Hence ++sum(n^2 times)

Total = 3n^2+ 3n+2

O(n^2) is the big O notation as we considered the maximum possible computation

6) no of computations are :

sum =0 - (1 time )

i=0 ( 1 times)

i<n ( n times )

++i (n times)

In the "j" th loop

j=0 ( n times)

j<i*i(this executes for max of n^3 times when i=n-1)

Similarly ++j (n^3 times when i=n-1)

In the "k" th loop

k=0 ( max of n^3 times when j=n^3)

k<j(max of n^4 times when j=n^3)

Similarly ++k(max of n^4 times when j=n^3)

Finally ++sum ( n^4 times when j=n^3)

Total = 3n^4+ 3n^3+3n+2

O(n^4) is the big O notation as we considered the maximum possible computation

5) no of computations are :

sum =0 - (1 time )

i=0 ( 1 times)

i<n ( n times )

++i (n times)

In the "j" th loop

j=0 ( n times)

j<i*i(this executes for max of n^3 times when i=n-1)

Similarly ++j (n^3 times when i=n-1)

In the "k" th loop

k=0 ( max of n^3 times when j=n^3)

k<j(max of n^4 times when j=n^3)

Similarly ++k(max of n^4 times when j=n^3)

Finally ++sum ( n^4 times when j=n^3)

Total = 3n^4+ 3n^3+3n+2

O(n^4) is the big O notation as we considered the maximum possible computation

8 0
3 years ago
Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer
Rainbow [258]

Answer:

Explanation:

The following is coded in Java. It asks the user for the number of inputs and then creates a loop to read all of the inputs and adds them to an ArrayList. Then it saves the last value in the array as the threshold. Finally, it loops through the array printing only the values less than or equal to the threshold. The program has been tested and the output can be seen in the image below.

import java.util.ArrayList;

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       ArrayList<Integer> myList = new ArrayList<>();

       System.out.println("How many inputs will you add? ");

       int inputs = in.nextInt();

       System.out.println("Enter inputs: ");

       for (int i = 0; i< inputs; i++) {

           int num = in.nextInt();

           myList.add(num);

       }

       int threshold = myList.get(myList.size()-1);

       System.out.println("Inputs Less than or Equal to Threshold: ");

       for (int x: myList) {

           if (x <= threshold) {

               System.out.println(x);

           }

       }

   }

}

8 0
3 years ago
Other questions:
  • Which form of malware contains hidden code that is triggered by meeting or reaching a specific condition? (A) Trap door (B) Viru
    12·1 answer
  • _____________ is fundamental rethinking and radical redesign of business processes. It helps achieve improvements in critical an
    13·1 answer
  • We all interact with various information systems every day: at the grocery store, at work, at school, even in our cars (at least
    11·1 answer
  • The total nodal delay includes:
    6·2 answers
  • A string with delimiters can be parsed into separate fields using the _____ class.
    8·1 answer
  • Computer privacy typically occurs when which of the following is violated?
    6·1 answer
  • Which of the following describes the purpose of a goal? Choose all that apply.
    13·2 answers
  • What is the meaning of url <br>​
    7·1 answer
  • Pa help please I need help<br>10 points :'(<br>nonsense report:<br>1 heart​
    12·1 answer
  • The set of coordinating colors applied to backgrounds, objects, and text in a presentation is called:
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!