Question: Write the code in C++.Kindly follow the given details. Question 4:Write a program to add two distances in inch-feet using structure. The function designed for
Question 4:Write a program to add two distances in inch-feet using structure. The function designed for sum should be inside the structure and inch must be added to inch and similar for feet. If inches exceed from 11 and reaches to 12 it will be a feet then there should be increment in feet sum and decrement in inch and leverage inches less than 12. The return type of the function should be struct. The function name should be "add" and the return type must be a struct; the function definition must be inside the structure. (Hint: 1 feet=12 inches) Function Prototype: struct dist add(struct dista, struct dist b)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
