subject
Computers and Technology, 25.02.2021 17:50 yorylee

Type the program's output// "New" means new compared to previous level#include using namespace std;class InchSize {public:InchSize(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; }

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:20
The kurt vonnegut commencement speech, the neiman-marcus chocolate chip cookie recipe, and the get-well emails to the dying boy are examples of select one: a. social engineering b. hoax emails c. email viruses d. worms
Answers: 1
question
Computers and Technology, 22.06.2019 18:30
Which of the following commands is more recommended while creating a bot?
Answers: 1
question
Computers and Technology, 23.06.2019 01:30
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most? a)give the file a unique name b)name the file in yymmdd format c)use descriptive name while naming the files d)use capital letters while naming the file
Answers: 3
question
Computers and Technology, 23.06.2019 02:00
In the context of an internet connection, llc stands for leased line connection liability limited company local loop complex local loop carrier
Answers: 1
You know the right answer?
Type the program's output// "New" means new compared to previous level#include using namespace std;c...
Questions
question
Social Studies, 29.01.2020 00:56
question
Mathematics, 29.01.2020 00:57
question
Social Studies, 29.01.2020 00:57
Questions on the website: 13722363