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
LAB: Formatted output: Hello World! Write a program that outputs "Hello World!" For ALL labs, end with newline (unless otherwise
maxonik [38]

Answer:

public class LabProgram {

  public static void main(String[] args) {

     System.out.println("Hello World!");    }  }

Explanation:

In this statement: System.out.println

System is a class in JAVA language package

out is a member of class System

println() is a functionT to print or display message to a console or file

So the message to print here is Hello World!

Now this statement   System.out.println prints the message "Hello World!" passed in the argument.

Hence this statement as a whole displays the message Hello World! on the output screen.

6 0
3 years ago
Question 3 / 5
Andrej [43]

Answer:

False

Explanation:

3 0
2 years ago
Is anyone else recieving a notification from brainly near the search bar about a message and click it and there nothing there???
Yakvenalex [24]

tessa the same with me I hate it and then I'll click I and then it's blank

4 0
3 years ago
How to connect two monitors to one computer with one hdmi port
Maslowich

Answer:

you would have to get an adapter that has another hdmi port

Explanation:

plug in the connecting wire to a hdmi adapter that has another hdmi port and then you can connect the other one in the adapter as well.

hope that helped

4 0
2 years ago
You work in an office that uses Linux and Windows servers. The network uses the IP protocol. You are sitting at a Windows workst
Westkost [7]

Answer:

The ping command.

Explanation:

In a network, workstations known as clients, users or nodes are the devices where data is needed or sents from. A server on the other hand, is a device in the network, configured to render a particular service like database, domain name service, web service etc.

When a link from a workstation to a server is down, the workstation looses connection the server. To confirm the connectivity of the link, "ping" the server ip address from the workstation using the command "ping 'server ip address'". This sends echo packets to the server, which is echoed back if there is connectivity.

6 0
3 years ago
Other questions:
  • Plz tell me a storage device that should be used for this and why
    11·1 answer
  • Read the scenario below. Explain why this is not fair use of copyright materials. What should you do instead of using the entire
    10·1 answer
  • In Microsoft Word you can access the _______ command from the "Mini toolbar." 
    9·1 answer
  • If you're under 18 and you receive _____ or more license points in 12 months, you'll be restricted to driving only to school or
    11·1 answer
  • Integer indexing array: Weekend box office The row array movieBoxOffice stores the amount of money a movie makes (in millions of
    11·1 answer
  • You are asked to provide a list of security groups a user is a member of. You write a script to pull the data from Active Direct
    11·1 answer
  • Pleas help 99 points and get brainliest
    9·2 answers
  • ¿que significa “TTAQMMQMPDATLSPLNDTMGCCLFEQMMPQTEIUMDR” ?
    5·2 answers
  • Different search engines available on the internet​
    7·1 answer
  • Enumerate five features of Microsoft excel 2016​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!