answer.
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
Law Incorporation [45]
1 year ago
14

Extend the functionality of cout by implementing a friend function in Number.cpp that overloads the insertion operator. The over

loaded insertion operator returns an output stream containing a string representation of a Number object. The string should be in the format "The value is yourNum", where yourNum is the value of the integer instance field of the Number class.Hint: the declaration of the friend function is provided in Number.h.Ex: if the value of yourNum is 723, then the output is:
Computers and Technology
1 answer:
san4es73 [151]1 year ago
7 0

Answer:

// In the number.cpp file;

#include "Number.h"

#include <iostream>

using namespace std;

Number::Number(int number)

{

   num = number;

}

void Number::SetNum(int number)

{

   num = number;

}

int Number::GetNum()

{

   return num;

}

ostream &operator<<(ostream &out, const Number &n)

{

   out << "The value is " << n.num << endl;

   return out;

}

// in the main.cpp file;

#include "Number.cpp"

#include <iostream>

using namespace std;

int main()

{

   int input;

   cin >> input;

   Number num = Number(input);

   cout << num;  

   return 0;

}

Explanation:

The main function in the main.cpp file prompts the user for the integer value to be displayed. The Number file contains defined functions and methods of the number class to set, get and display the "num" variable.

You might be interested in
Which is among the earliest formats of audio used in video games? A. MP3 B. wave table synthesis C. pulse code modulation D. MOD
solong [7]

Answer:

MOD

Explanation:

MOD audio file format is primarily used to represent music. It uses the .MOD file extension and has had popularity as background music for independent video games. It would be safe to say that MOD audio file extensions are the most widespread trackers that were used and are still being used in many computer games and demos.

0 0
1 year ago
Read 2 more answers
Explain what might happen if two stations are accidentally assigned the same hardware address?
Firdavs [7]

Answer: If two different station are addressed with the same hardware address then there are chances of occurrence of the failure in the network at irregular intervals.The failure or error will occur because of the both the devices are seen as one by the network due to same address.

An intelligent network system id used ,it can identify the error can help in the prevention of the failure.Other option for configuring the situation is assigning the MAC(media access control)address to devices which are unique in nature thus, no device can have same address.

5 0
1 year ago
Information is stored on a compact disk in a coded pattern of tiny pits arranged in a track that spirals outward toward the rim
Maksim231197 [3]

Answer:

(i) The rotation speed must stay the same.

(ii) The rotation speed must increase.

(iii) The rotation speed must decrease.

Explanation:

According to Equation

10.10, the angular speed must therefore vary as the laser–lens system moves

radially along the disc. In a typical CD player, the constant speed of the surface at

the point of the laser–lens system is 1.3 m/s.

5 0
1 year ago
A bicycle sharing company is developing a multi-tier architecture to track the location of its bicycles during peak operating ho
fgiga [73]

Answer:

d use Amazon API Gateway with Amazon kinesis...

5 0
1 year ago
Steven is an advertising executive at a large auto parts company. He uses his google ads recommendations page to help him with s
lana [24]

Answer:

Apply recommendations across the multiple layers of his advertising strategies.

Explanation:

In the given statement, Steven is an employee of an organization of auto parts and he uses own google advertisement page for the purpose of strategies to make perfect he owns advertisement campaigns for the google search. He values the scores of the optimization because Steve applies charge over the different layers of his ads strategies.

4 0
2 years ago
Other questions:
  • When workers demonstrate patience, are able to manage there emotions, and get along with other employees, which skills are being
    11·2 answers
  • Which references are updated when you copy the formula =$E6-MAX(H$1:J4)
    10·1 answer
  • Consider a DASH system for which there are N video versions (at N different rates and qualities) and N audio versions (at N diff
    8·1 answer
  • When Jen is planning to upgrade to a monitor with a better resolution, what should she be looking for in the new monitor? machin
    11·1 answer
  • A queueing system has four crews with three members each. The number of "servers" is:
    5·2 answers
  • You have configured your firewall to authenticate a group of 100 users who are in your company. You set up the database of users
    14·1 answer
  • Identify the articulation site that allows us to nod our head ""yes"".
    13·1 answer
  • Determining the Services Running on a Network Alexander Rocco Corporation has multiple OSs running in its many branch offices. B
    10·1 answer
  • g 18.6 [Contest 6 - 07/10] Reverse an array Reversing an array is a common task. One approach copies to a second array in revers
    8·1 answer
  • Which of the following is an advantage of inserting a page number field in your document rather than inserting each page number
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!