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 03:10
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it must not appear in the factorization. sample runs are given below. note that if the power of a prime is 1, then that 1 must appear in t
Answers: 3
question
Computers and Technology, 23.06.2019 23:00
Lucas put a lot of thought into the design for his company's new white paper. he made sure to include repeating design elements such as color schemes and decorative images. his goal was to a.add symmetry b.create a unified publication c.provide consistency d.save money
Answers: 1
question
Computers and Technology, 24.06.2019 02:10
Consider the usual algorithm to convert an infix expression to a postfix expression. suppose that you have read 10 input characters during a conversion and that the stack now contains these symbols: (5 points) | | | + | | ( | bottom |_*_| now, suppose that you read and process the 11th symbol of the input. draw the stack for the case where the 11th symbol is
Answers: 2
question
Computers and Technology, 24.06.2019 07:00
Into what form does the barcode reader convert individual bar patterns?
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
Mathematics, 12.01.2021 08:30
question
Mathematics, 12.01.2021 08:30
question
Social Studies, 12.01.2021 08:30
Questions on the website: 13722367