write a C++ program Create a class 'Distance' with data member 'inches'. Along with member functions that read user inpu

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

write a C++ program Create a class 'Distance' with data member 'inches'. Along with member functions that read user inpu

Post by answerhappygod »

write a C++ program
Create a class 'Distance' with data member 'inches'. Along with
member functions that read user inputs and print data
members value, Your class should also have a function that
takes two objects i.e instances of Distance class and
calculate the sum of distances and output in terms of
feets and inches. (1 feet = 12 inches)
input
90
92
output
15' 2"
please use:
int main()
{
Distance d1, d2, d3;
d1.getDistance();
d2.getDistance();
d3.distanceSum(d1,d2);
d3.showDistance();
}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply