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
Ilya [14]
3 years ago
11

C++

Computers and Technology
1 answer:
Nookie1986 [14]3 years ago
7 0

Answer:

Following are the code to the given question:

#include <iostream>//header file

using namespace std;

class Window //defining a class Window

{

private:

int width, height;//defining integer variable

public:

friend ostream& operator << (ostream& stm, Window& width)//defining a friend function that takes two parameters

{

return stm<<"a ("<<width.width<<" x "<<width.height<<") window"; //use return keyword that return its values

}  

Window(int width, int height): width(width), height(height)//defining parameterized constructor that inherit width and height in its parameters  

{}

};

int main() //Main method

{

Window w(80,90);//calling class constructor

cout<<w;//print object value

return 0;

}

Output:

a (80 x 90) window

Explanation:

In the above code, a class "Window" is defined that uses a friend function "ostream& operator" is declared that uses the "ostrea&" as a data type to hold two-variable "stm and w" in its parameter, and declared the parameterized constructor to hold value by inheriting width and height in its parameters.

Inside the main method, a class object is created that calls the constructor and uses the print method to print object value.

You might be interested in
What does this sign mean?
yKpoI14uk [10]
A. yield to the car on your right
8 0
3 years ago
Read 2 more answers
What new england industry quickly collapsed with the discovery of oil in pennsylvania
Elena-2011 [213]

It was the whaling industry.  Whaling use to be the main source of oil that was used for fuel and lighting in America which was based in the coastal communities of New England.  It went into decline when oil was discovered in 1859.  Eventually it replaced whale oil as a source of fuel and life.

6 0
3 years ago
Read 2 more answers
Black box testing is the practice of writing tests without knowing the implementation of the code you're testing. White box test
Lelu [443]

Answer:

<u>First test:</u> Give a list of disordered numbers to the sorting algorithm an examine if the output is correctly sorted.

<u>Second test:</u> Give a list of ordered numbers to the sorting algorithm an analyze if the output is still correctly ordered.

<u>Third test:</u> Give a list of ordered numbers and some non-numeric values to the sorting algorithm and check how is managed the exception in case of error or if the output is correctly ordered.

6 0
3 years ago
What is the primary language used to write web content and is the default format for Outlook messages?
Doss [256]

Answer:

I think its plain text but I might be wrong

7 0
3 years ago
((11111111-1011100) X (10100 / 10))- ( 110010000+ 1110011)
dsp73

Answer:

10089891099

Explanation:

?

3 0
3 years ago
Other questions:
  • You have a network of 300 users. You are finding that you must frequently restore files from backup that users have accidentally
    13·1 answer
  • You are given a data set with information from 1,000 high school students (of which the following is a part of the data) and ask
    6·1 answer
  • Jose wants to be sure maintains a high credit score as he is planning yo buy a new car soon what should he do to ensure his scor
    13·2 answers
  • A complete traversal of an n node binary tree is a(n)____ "operation if visiting a node is O(1)for the iterative implementation
    5·1 answer
  • At age 16 Cheyanne just got her drivers license
    5·2 answers
  • Discuss some design considerations that you should keep in mind when you want to design a professional-looking flyer or newslett
    12·1 answer
  • Any fact or set of facts, such as the words in a letter to a friend or the notes in a song, can become computer ____.
    7·1 answer
  • This isn't a question
    8·1 answer
  • your teacher has accidentally put the wrong names of the students on her excel science results sheet. What method can be used to
    7·1 answer
  • he primary purpose of a database query is to a. find and retrieve specific information. b. correct information in the database.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!