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
Gennadij [26K]
3 years ago
15

Why is a class an excellent representation of an abstract data type?

Computers and Technology
1 answer:
JulsSmile [24]3 years ago
6 0

Answer:

 A class is an good representation of the abstract data type as it is represented independently. For implementing a class, it is use to specify the interface for an abstract class.

Class is one of the type of abstract data type for the objects that whose behavior is basically define by the set of operations and values. It is known as abstract as, it provide an implementation independently.

When the class is using in an abstract data type, then it refers as hidden representation of the data. In this modern era, class is use for the implementation of the abstract data type.

You might be interested in
Exercise#3: Write a ch program that performs the following: Declare a two arrays called arrayA and arrayB that holds integer and
Serga [27]

Answer:

The code for this problem is completed here. Comments are added, go and learn how things work.

Explanation:

// Arrays.java

import java.util.Random;

import java.util.Scanner;

public class Arrays {

     // method to fill an array with random numbers between low and high

     static void fillArray(int array[], int low, int high) {

           Random random = new Random();

           for (int i = 0; i < array.length; i++) {

                 // generating a value between low and high inclusive, adding to

                 // array

                 array[i] = random.nextInt(high - low + 1) + low;

           }

     }

     // method to print elements in an array

     static void printArray(int array[]) {

           for (int i = 0; i < array.length; i++) {

                 // displaying elements separated by tab space

                 System.out.print(array[i] + "\t");

                 // printing a line break after every 5th element, or if this is the

                 // last element.

                 if ((i + 1) % 5 == 0 || i == array.length - 1) {

                       System.out.println();

                 }

           }

     }

     // method to count the number of elements in array greater than value

     static int count(int array[], int value) {

           // initializing count to 0

           int c = 0;

           for (int i = 0; i < array.length; i++) {

                 if (array[i] > value) {

                       // incrementing c

                       c++;

                 }

           }

           return c;

     }

     // returns true if two arrays are same, else false

     static boolean isSame(int array1[], int array2[]) {

           if (array1.length != array2.length) {

                 // lengths mismatch

                 return false;

           }

           // checking if elements are same in same order

           for (int i = 0; i < array1.length; i++) {

                 if (array1[i] != array2[i]) {

                       // mismatch found

                       return false;

                 }

           }

           // same

           return true;

     }

     // returns the average of elements in an array

     static double findAverage(int array[]) {

           double sum = 0;

           // summing values

           for (int i = 0; i < array.length; i++) {

                 sum += array[i];

           }

           // finding average

           double avg = (double) sum / array.length;

           return avg;

     }

     // method to count the number of values greater than average of an array

     static int aboveAverage(int array[]) {

           // finding average of passed array using findAverage method

           double avg = findAverage(array);

           // finding number of elements in array>avg using count method

           int c = count(array, (int) avg);

           return c;

     }

     public static void main(String[] args) {

           // setting up a Scanner

           Scanner scanner = new Scanner(System.in);

           // prompting and reading size of arrayA

           System.out.print("Enter size of arrayA: ");

           int n1 = scanner.nextInt();

           // initializing arrayA

           int arrayA[] = new int[n1];

           // doing the same for arrayB

           System.out.print("Enter size of arrayB: ");

           int n2 = scanner.nextInt();

           int arrayB[] = new int[n2];

           // asking and reading low and high values

           System.out.print("Enter low and high values for random numbers: ");

           int low = scanner.nextInt();

           int high = scanner.nextInt();

           // filling both arrays

           fillArray(arrayA, low, high);

           fillArray(arrayB, low, high);

           // printing both arrays

           System.out.println("arrayA:");

           printArray(arrayA);

           System.out.println("arrayB:");

           printArray(arrayB);

           // reading an integer

           System.out.print("Enter an integer value: ");

           int value = scanner.nextInt();

           // displaying the number of elements in each array greater than above

           // value

           System.out.println("The number of elements greater than " + value

                       + " in arrayA: " + count(arrayA, value));

           System.out.println("The number of elements greater than " + value

                       + " in arrayB: " + count(arrayB, value));

           System.out.println("Both arrays are same: " + isSame(arrayA, arrayB));

           // finding and displaying average of arrayA

           double avgA = findAverage(arrayA);

           System.out.println("Average of all values in arrayA: " + avgA);

           // finding and displaying number of elements in arrayB greater than the

           // average of arrayB

           System.out.println("The number of elements greater than "

                       + "the average of arrayB" + " in arrayB: "

                       + aboveAverage(arrayB));

     }

}

6 0
3 years ago
Able to make a survey form using VB (Visual basics 6.0) to represent ways of conservation of
Nadusha1986 [10]
40 is the right answer
6 0
2 years ago
Read 2 more answers
Write a program to add two number marie simulator.
Gnoma [55]
Int a, b;
cout<<"write to numbers";
cin>>a>>b;
cout<
8 0
3 years ago
The___ allows you quickly access features such as formatting, charting, tables, and totals
cricket20 [7]

Answer:

Quick Analysis toolbar

Explanation:

it appears with the options formatting, chart, total, table, sparklines

7 0
3 years ago
Explain why a document created by word processing software is stored as a binary file.​
Savatey [412]

Answer:

Refer below.

Explanation:

Binary DOC records regularly contain more content organizing data (just as contents and fix data) than some other document designs like Rich Text Format and Hypertext Markup Language, however are normally less broadly good.

The DOC documents made with Microsoft Word renditions contrast. Microsoft Word forms before Word 97 ("8.0") utilized an alternate organization from the OLE/CFBF-based Microsoft Word 97 – 2003.

In Microsoft Word 2007 and later, the binary document design was supplanted as the default position by the Office Open XML group, however Microsoft Word can in any case produce DOC records.

3 0
3 years ago
Other questions:
  • Write an original idiom that uses the word dog or dogs im in 4th
    5·2 answers
  • At age 16 Cheyanne just got her drivers license
    5·2 answers
  • Which of the following is an object-oriented prototype-based language? Java Pike REBOL MATLAB
    9·1 answer
  • The set of rules for how computers talk to one another
    6·1 answer
  • What is the point of brainy when other people have to answer your questions but not the cumputer
    9·1 answer
  • Does white space have visual weight? Yes or No
    7·2 answers
  • For a business that is properly using a social media information system, the system can
    13·1 answer
  • Which game would you play info you were competitive?
    13·2 answers
  • Lily obtained data from five trails 50 kcal 72 kcal 12 kcal and 50 kcal which best decribes her data
    11·1 answer
  • Write a method named addCommas that accepts a string representing a number and returns a new string with a comma at every third
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!