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
True or false?
AnnZ [28]

Answer:

True

Explanation:

Media coding is the procedure of defining the Media codes, written symbolic and technical tools that are applied to construct or come up with the meaning in various media products or forms. It includes the proper use of the camera, setting, acting, editing, special effects, sound, color, text, visual composition, graphics, typography, and mise en scene. Hence, the fact mentioned in the question is true.

7 0
3 years ago
Write a program with class name Digits that prompts the user to input a positive integer and then outputs the number reversed an
mr Goodwill [35]

Answer:

Written in Python:

inputnum = int(input("User Input: "))

outputnum = 0

total = 0

while(inputnum>0):

     remainder = inputnum % 10

     outputnum = (outputnum * 10) + remainder

     inputnum = inputnum//10

     total = total + remainder

print("Reverse: "+str(outputnum))

print("Total: "+str(total))

Explanation:

This prompts user for input

inputnum = int(input("User Input: "))

This initializes the reverse number to 0

outputnum = 0

This initializes total to 0; i.e. sum of each digit

total = 0

The following iteration gets the reverse of user input

<em>while(inputnum>0): </em>

<em>      remainder = inputnum % 10 </em>

<em>      outputnum = (outputnum * 10) + remainder </em>

<em>      inputnum = inputnum//10 </em>

<em>      This adds each digit of user input</em>

<em>      total = total + remainder </em>

This prints the reversed number

print("Reverse: "+str(outputnum))

This prints the sum of each digit

print("Total: "+str(total))

7 0
3 years ago
Which command suppresses the visibility of a particular row or column in a worksheet?
Gwar [14]

Answer:

Hide command suppresses the visibility of a particular row or column in a worksheet

Explanation:

Hide command is used to hide the row or column in an excel worksheet. To suppress the visibility of a particular row or column in a worksheet, you have to select that particular row or column and then right-click on column or row header. A popup screen will appear as like when you refresh the computer. Then on this screen, at the bottom, you will find the hide command, click the hide command. And, as you click the hide command that particular row or column will become invisible. if you want to show it again, click the Unhide command. Therefore, hide command suppresses the visibility of a particular row or column.

Why other options are not correct

Autofit

Autofit command is used when you want that a particular cell of row or column to automatically adjust / or accommodate the content. Autofit command does not affect the visibility of a row or column.

Insert

Insert command is used to insert contents in a particular worksheet. Insert command is based on groups of various commands such as inserting tables, charts, graphs, text, symbols, add-ins, sparklines, and links.

Replace

Replace command is used in excel to replace the text with some other text. If you want to replace some text with some other text, then you have to use the replace command.

8 0
3 years ago
A data mart is the operational database for the company. group of answer choices true false
netineya [11]

The statement 'a data mart is the operational database for the company' is true.

We can define a data mart as a  subject-oriented database that focuses on a particular area in an organization.

It is through data mart that the employees of a company can access data faster. Data mart, functioning as the operational database, helps employees as they do not have to manually add all the data again. Also, any piece of data needed by an employee can easily be accessed through the data mart of the company.

One of the advantages of using data mart is that it eradicates human-made errors which can arise if data is added manually by an employee.

To learn more about data mart, click here:

brainly.com/question/25013185

#SPJ4

8 0
2 years ago
Write a Python statement that displays the value referenced by the number variable formatted as1,234,567.5
bulgar [2K]

Answer:

x = 1234567.5

print(f'{x:,}')

* there's various ways to accomplish this, but above seems to be the shortest. Requires python ≥ 3.6

8 0
3 years ago
Other questions:
  • Select one of the following strategies: active listening, sandwich technique, constructive feedback. in 2-5 paragraphs, define a
    11·1 answer
  • What types of roles are there as a webmaster?
    6·2 answers
  • Given the char variable c, write an expression that is true if and only if the value of c is not the space character .
    7·1 answer
  • Suppose you are choosing between four different desktop computers: one is Apple MacIntosh and the other three are PC-compatible
    15·1 answer
  • A reference parameter differs from an output parameter in that a reference parameter ______________________ but an output parame
    5·1 answer
  • Which of the following words best describes the word icon ​
    14·2 answers
  • I don’t understand this, i need help
    7·1 answer
  • Why can’t I see one individual’s questions in the app through their profile, but I can see their questions on the website?
    12·2 answers
  • A statement that starts with a # symbol is called
    8·1 answer
  • Question: 4/8
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!