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
Romashka [77]
4 years ago
15

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

Computers and Technology
1 answer:
KIM [24]4 years ago
3 0

Answer:

Output:<em> </em><em>15 11/16 inches</em>

Explanation:

#include <iostream>

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;

}

////////////////////////////////////////////////////////////////////////

sumSize variable was printed in the end. Print() prints the calling object's inches and sixteenths variables' values.

sumSize's inches is equal to size1 plus size2's inches.

Because the sum of sixteenths was greater than 16, sumSize's sixteenth was decreased by 1 and inches was increased by 1.

You might be interested in
Methods inherited from the base/super class can be overridden. This means changing their implementation; the original source cod
Inessa05 [86]

Answer:

False

Explanation:

Methods inherited from the base/super class can be overridden only if behvior is close enough. The overridding method should have same name, type and number of parameters and same return type.

6 0
3 years ago
Hello guys where's bios chip in this motherboard ​
dolphi86 [110]

Answer: This. is an old Asus Board and the chip is missing

Explanation: The BIOS chip goes into the Processor holder. the one with the curved metal arm to help release it (goes into the cage first you use glue made for ) installing the chip, then you place the processor on top of that big part where it resembles a slice of bread.  You lock down the four legs and that is the brain of the MB.

To update the BIOS,in the machine outside of the operating system. ON WIndows it is the command center on Mac it is different.

The CMOS Battery is next to the word ASUS .

The BIOS is code and software that you upload from the manufacturer's site like ASUS.  and in the command environment, you update the bios.

The CHIP is delicate and it ONLY GOES  on ONE WAY! BE Verry very careful installing the chip and processor better to have a pro (like me ) do it ...

Motherboards are very delicate and expensive! All parts go one way and one way only. Be glad you don't have to Sauter anything.

3 0
1 year ago
What are the benefits if you pay off all your high-interest debt such as credit
lesya [120]
D. All of the above
7 0
3 years ago
Read 2 more answers
Photography Class help!
Pachacha [2.7K]
Yes, I think that the answers are D and C. I think thats correct.
Hope I helped!
7 0
3 years ago
Read 2 more answers
Where does the data go for the following instructions?<br><br> LDX #$2000<br> STAA $60,X
vagabundo [1.1K]

Answer: LDX copies the instruction pointed by the memory location into the accumulator. STAA stores the content of the accumulator in the memory location $

Explanation:

Here in LDA #$2000, copies the instruction pointed by the memory location $2000 into the Accumulator A, and it uses indirect addressing.

STA $60,X stores the content of A into the memory location assigned by $60 and assigns it to X.

6 0
4 years ago
Other questions:
  • Which of these tools can best be used as a self assessment for career planning purposes
    12·1 answer
  • Print a countdown from n to 1 The function below takes one parameter: an integer (begin). Complete the function so that it print
    8·1 answer
  • Which function returns a valid value without any arguments?
    13·2 answers
  • Suppose that you have created a program with only the following variables.int age = 34;int weight = 180;double height = 5.9;Supp
    7·1 answer
  • Which flowchart symbol indicates the start or the end of a process?
    8·1 answer
  • Instructions:Emotet is an advanced banking Trojan that primarily functions as a downloader of other Trojans. According to the Sy
    13·2 answers
  • Write a method named collapse that accepts an array of integers as a parameter and returns a new array where each pair of intege
    6·1 answer
  • An engineer is designing an HTML page and wants to specify a title for the browser tab to display, along with some meta data on
    12·1 answer
  • WHAT ACTIONS CAUSE SPAM ON LINKEDIN?
    5·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!