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
Assoli18 [71]
1 year ago
8

assume a class named window has an accessor method named getwidth that accepts no parameters and returns an int. assume further

an array of 3 window elements named winarr, has been declared and initialized. write a sequence of statements that prints out the width of the widest window in the array.
Computers and Technology
1 answer:
worty [1.4K]1 year ago
5 0

The set and get functions are analogous to the accessor and mutator functions of C++. They are used in place of modifying a class member directly inside an object and making it public. An accessor function must be invoked in order to gain access to a private object member.

int mVal = winarr[0].getWidth();

for(int i = 1; i < winarrsize; i++)

{

  if(winarr[i].getWidth() > mxVal)

     mVal = winarr[i].getWidth();

}

cout << "The widest width is: "

<< mVal << endl;

By using encapsulation, a programmer can specify the labels for the data members and functions as well as whether or not other classes can access them. When data members are marked as "private," member functions of other classes cannot access or modify them which allows members access to these private data.

For a member such as Level, a function like GetLevel() returns the value of the member, while a function like SetLevel() gives it a value.

To learn more about Accessor Function click here:

brainly.com/question/13098886

#SPJ4

You might be interested in
Which ribbon tab is home to the Function library used to insert functions into worksheets?
Sedaia [141]
The correct answer is C: Formulas
3 0
3 years ago
Read 2 more answers
Computer designers have concentrated on technology using gallium arsenide instead of silicon because silicon:
cestrela7 [59]

Answer: cannot emit light and has speed limitations

Explanation:

Silicon is usually used in computer chips and solar cells but Gallium arsenide is regarded as a better alternative even though it's costly than silicon.

Gallium arsenide has technical advantages over silicon as its electrons

move through it faster than they move through silicon. Also, cannot emit light and has speed limitations.

Gallium arsenide is used in manufacturing devices like infrared light-emitting diodes, solar cells, optical windows, etc.

7 0
3 years ago
Make a ladtract class that has 2 fields, one for the tractor's length and one for the width. The class should have a method that
Virty [35]

Explanation:

Below is the java code for the ladtract class :-

public class ladtract

{

private double length;  //length of tractor

private double width;   //width of tractor

public double calculateArea(){  

    return length*width;    //calculate and return the area of the tractor

}

public boolean equals(Object o) {

    if (o == this) {    //check if it's the same object

        return true;

    }

       if(o.length==this.length && o.width==this.width){   //check if the length and width are same for both objects

           return true;

       }

       return false;  

}

public String toString(){

    return "Area="+calculateArea(); //return the area of the tractor as a string

}

}

7 0
3 years ago
_____ is an advanced optical disc technology that can store up to 3.9 terabytes, roughly 75–150 times more data than the Blu-ray
Anettt [7]

Answer:

"The holographic versatile disc".

Explanation:

According to my research on optical disk technology, I can say that based on the information provided within the question the technology being described in the question is called a "The holographic versatile disc".

Unfortunately it is not shown as an available answer but it is the correct answer. This is the only optical disk technology capable of holding 3.9 terabytes of data as well as meeting the specs mentioned in the question.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

7 0
4 years ago
The quickbooks online advanced desktop app can be installed on which operating system?.
lorasvet [3.4K]

Explanation:

For Android products, your device will need to be running Nougat 7.1. 1 or newer.

6 0
2 years ago
Other questions:
  • _________ is a specially formatted request used to perform ip address to data link address resolution.
    14·1 answer
  • What do you think of explaining to young people, from high school, the legitimacy of copyright and the dangers they can run on t
    11·1 answer
  • The point where a row and column intersect is called a/an A. cell. B. axis. C. element. D. table.
    7·2 answers
  • You can change the color of the value of a cell or the background color of the cell but not both.
    5·2 answers
  • Your company has been using Windows workgroups on a server running Windows Server 2016. Due to the rapid growth of the company,
    9·1 answer
  • How do i beat the final battle in lara croft: temple of osiris?
    9·1 answer
  • __________ systems support the search for and sharing of organizational expertise, decision making, and collaboration at the org
    9·1 answer
  • In information security, a specification of a model to be followed during the design, selection, and initial and ongoing impleme
    5·1 answer
  • Write the code to create a variable score and assign it the value 0?​
    6·1 answer
  • On tool hackers use to get sensitive information from victims is/are:
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!