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
matrenka [14]
3 years ago
13

Type the program's output// "New" means new compared to previous level#include using namespace std;class InchSize {public:InchSi

ze(int wholeInches = 0, int sixteenths = 0);void Print() const;InchSize operator+(InchSize rhs);InchSize operator+(int sixteenthsOfInch);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;}// New: Overloaded + operator adding integers.InchSize InchSize::operator+(int sixteenthsOfInch) {InchSize totalSize;totalSize.inches = inches;totalSize.sixteenths = sixteenths + sixteenthsOfInch;// While sixteenths is greater than an inch, carry to inches.while (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(4, 13);InchSize size2(3, 11);InchSize sumSize;InchSize totalSize;sumSize = size1 + size2;totalSize = sumSize + 18;totalSize.Print();return 0;
}
Computers and Technology
1 answer:
alexira [117]3 years ago
4 0

Answer:

The output of the code is "2 10/16 inches".

Explanation:

It first declares size1 as that of an InchSize object to 1 and 16 cm as 12. InchSize object size2 to four and sixteenth inches as 11 inches

Whenever users add size1 and size2 in sumSize, it will become 5 inches as well as 23 and 16ths, however, the size will be reduced as well as the sixteenths larger than 16 will be converted to 1 inch. So 6 inches, 7 sixteenths, will become it. Then you're trying to subtract the amount of room left (which is 9 inches and 1 sixteenths)

It would first be 3-6 inches -6 16th, but the shape is reduced although it will take 2 inches - 10 sixteenths. It's the response.

You might be interested in
Why team goals should be broken into shon-term, medium-term, and long-term goals
lora16 [44]

Answer:

Explanation: Goals should be broken down according to time because it allows the team to decide what their overall purpose is, and to define the actions that will allow them to achieve their overall purpose.

7 0
3 years ago
Read 2 more answers
Which model states that the people and the environment for communication are constantly changing? A. linear B. interactive C. tr
In-s [12.5K]

The interactive model of communication states that the people and the environment for communication are constantly changing.

B. interactive

<u>Explanation:</u>

The world is a big place and you must have come across the infamous hearing, "Change is the only constant". Gradually, with the passage of time, the mindset of the people change over a certain topic for communication.

For instance, in old times, people did not prefer their children to have love marriages, in fact India has also seen honor killings to prevent love marriages. But now most portion of the society stands in favor of love marriages. People change, perspective change, and so does the perception and ideas.

6 0
3 years ago
The slide layout has placeholders for text, charts, and tables. true or false.
Ksju [112]
The answer to this is true
3 0
4 years ago
Read 2 more answers
I need help. People who know computer science. I have selected a word from the first 1000 words in my dictionary. Using the bina
Rudiy27

Answer:

14

Explanation:

8 0
3 years ago
Complete two examples of how scientists, technologists, engineers, and mathematicians may work together to create a new product
asambeis [7]

Answer:

By thinking of ways to create environment friendly products such as biodegradable water bottles

3 0
3 years ago
Other questions:
  • In the 1960s, techniques were developed that allowed individuals to fool the phone system into providing free access to long dis
    14·1 answer
  • Write a program in c or c++ to perform different arithmeticoperation using switch statement .the program will take two inputinte
    10·1 answer
  • Which of the following types of network can only be accessed by members within a private organization?
    5·1 answer
  • Your unit has an upcoming training event. What form is used to record and maintain document numbers for ammunition documents?
    5·1 answer
  • A man-made world event that would affect the labor market would be a(n) _____.
    13·1 answer
  • Camera lenses typically have very long focal points. true or false.
    5·2 answers
  • Which PlayStation was the first to allow connection between it and computer network
    12·1 answer
  • I'm gonna get grounded for getting a 52 on my test :(
    13·1 answer
  • Computers help eliminate that repetitive of manual task. How can this benefit you in in your overall career
    7·2 answers
  • Class C Airspace inner ring begins at the __________ and extends vertically (by definition) to MSL charted values that generally
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!