Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Complete the function ConvertToFeetAndInches to convert totalInches to feet and inches. Return feet and inches using the WidthFtIn struct. Ex: 2 6 inches is 2

Complete the function ConvertToFeetAndInches to convert totalInches to feet and inches. Return feet and inches using the WidthFtIn struct. Ex: 26 inches is 2 feet and 2 inches.
#include
using namespace std;
struct WidthFtIn {
int feetVal;
int inchesVal;
};
WidthFtIn ConvertToFeetAndInches(int totalInches){
WidthFtIn tempVal;
/* Your code goes here */
}
int main(){
WidthFtIn objectSize;
int totalInches;
cin >> totalInches;
objectSize = ConvertToFeetAndInches(totalInches);
cout << objectSize.feetVal <<" feet and "<< objectSize.inchesVal <<" inches" << endl;
return 0;
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions