subject

What is the output of the following C++ program?

#include
using namespace std;
class InchSize
{
public:
InchSize(int wholeInches = 0, int sixteenths = 0);
void Print() const;
InchSize operator+(InchSize rhs);
private: int inches; int sixteenths;
};
InchSize InchSize::operator+(InchSize rhs) {
InchSize totalSize; totalSize. inches = inches + rhs. inches; totalSize. sixteenths = sixteenths + rhs. sixteenths;
// If sixteenths is greater than an inch, carry 1 to inches.
if (totalSize. sixteenths >= 16) {
totalSize. inches += 1; totalSize. sixteenths -= 16;
}
return totalSize;
}
InchSize::InchSize(int wholeInches, int sixteenthsOfInch) {
inches = wholeInches; sixteenths = sixteenthsOfInch;
}
void InchSize::Print() const { cout << inches << " " << sixteenths << "/16 inches" << endl;
}
int main()
{
InchSize size1(5, 13); InchSize size2(9, 14); InchSize sumSize; sumSize = size1 + size2; sumSize. Print(); return 0;
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:30
How can you know if the person or organization providing the information has the credentials and knowledge to speak on this topic? one clue is the type of web site it is--the domain name ".org" tells you that this site is run by a nonprofit organization.
Answers: 2
question
Computers and Technology, 24.06.2019 01:00
The initial tableau of a linear programming problem is given. use the simplex method to solve it. x 1 x 2 x 3 s 1 s 2 z 1 2 4 1 0 0 8 3 4 1 0 1 0 10 minus3 minus12 1 0 0 1 0 the maximum is nothing when x 1equals nothing, x 2equals nothing, x 3equals nothing, s 1equals3, and s 2equals0. (be sure to simplify to lowest terms if necessary.)
Answers: 2
question
Computers and Technology, 24.06.2019 16:30
What is the item which could be matched with a statement below? software installed on a computer that produces pop-up ads using your browser an example of social engineering malware loads itself before the os boot is complete type of spyware that tracks your keystrokes, including passwords windows key + l the practice of tricking people into giving out private information or allowing unsafe programs into the network or computer when someone who is unauthorized follows the employee through a secured entrance to a room or building a type of malware that tricks you into opening it by substituting itself for a legitimate program a computer that has been hacked, and the hacker is using the computer to run repetitive software in the background without the user's knowledge an infestation designed to copy itself repeatedly to memory, on drive space, or on a network
Answers: 1
question
Computers and Technology, 24.06.2019 17:30
Match the following. 1. formatting that is applied when cell data meets certain criteria 2. borders with formats not found on the border tool 3. a shortcut bar that contains tools for commonly used formats 4. formats that can be applied to numbers conditional formatting custom borders format bar number formats
Answers: 3
You know the right answer?
What is the output of the following C++ program?

#include
using namespace std;
Questions
Questions on the website: 13722363