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
You recently purchased a new laptop for home. You want to ensure that you are safe from malware. You should install a personal _
german

Answer:

You should install a personal firewall, a program that protects your computer from unauthorized access by blocking certain types of communications.

Explanation:

In computing, a firewall is a network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules. A firewall typically establishes a barrier between a trusted internal network and untrusted external network, such as the Internet.

8 0
4 years ago
Which of the following describes a decision support system (DSS)?
levacccp [35]

Answer:

B.

Explanation:

8 0
3 years ago
Read 2 more answers
Controller Area Network CAN B bus diagnostics is being discussed. Technician A says some modules do not set specific codes that
miss Akunina [59]

Answer:

Both Technician A and Technician B is correct.  

Explanation:

CAN (Controller Area Network) is specially designed for the European cars and the automotive industry, but it has become the popular bus in the industrial automation and also in other applications.  

CAN is the serial communication bus that is designed for flexible and robust performance in a harsh environment.

3 0
4 years ago
The ____ line for any e-mail messages you write should clearly state the intention of the e-mail..
KatRina [158]

The <u>subject </u>line for any e-mail messages you write should clearly state the intention of the e-mail.

Electronic mail (e-mail) is a method of digital communications in which messages are exchanged through the internet. The messages are sent from a sender to one or more receivers.  Depending on user’s perspective, every user uses e-mail differently.  Communicating via e-mail requires e-mail platforms such as G*mail, Ya*hoo! Mail, Hot*mail, and Out*look etc. In the every e-mail, there is a subject line that clearly state the intention of the e-mail.

Subject line is an important element of an e-mail. Through the subject line, the message written in the e-mail is briefly summarized in six to eight words. A clearly written subject line provides the recipient a clear understanding that why the email has been sent. When recipient replies back to the e-mail, the subject line is changed accordingly.

This is the subject line of the e-mail that convince the receiver whether to open and read the e-mail. So, it should be written in the way that gives clear intention of the e-mail. We can say that the subject line of the e-mail is the most significant few words in the whole e-mail to convey the main purpose of the e-mail.

You can learn more about subject line at

brainly.com/question/14572730

#SPJ4

3 0
2 years ago
Write a full class definition for a class named Counter, and containing the following members: A data member counter of type int
vfiekz [6]

// making the class

class Counter {

int counter;

int limit;

// Constructor

Counter(int a, int b){

counter = a;

limit = b;

}

// static function to increment

static increment(){

if(counter<limit)

nCounter+=1;

}

// Decrement function

void decrement(){

if(counter>0)

nCounter-=1;

}

int getValue(){

return counter;

}

static int nCounter;

int getNCounters(){

return nCounter;

}

};

// Initializa the static

int Counter::nCounter = 0;

4 0
4 years ago
Other questions:
  • Why are many otherwise safety-conscious people victims of Internet crime?
    13·1 answer
  • The file type blank identifies a word 2013 document
    12·1 answer
  • The author of ""Cyber-psychopathy: What Goes On in a Hacker’s Head"" states that a crucial component of computer hacking lies in
    6·1 answer
  • What are the benefits of maintaining your vehicle?
    5·2 answers
  • Power point presentation make use of pages known as
    9·2 answers
  • When we code an algorithm, we need to provide the commands in the order we want the
    10·1 answer
  • Can someone help me plz
    13·2 answers
  • Describe how to find and replace a text in a document​
    13·1 answer
  • CODEHS- Please help!
    8·1 answer
  • What are the main advantages of the d-step tuning of 2023 murano’s xtronic cvt®?.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!