Page 1 of 1

Create a program with a constructor function. The program should contain the ff: • A Distance class and constructor • Va

Posted: Mon May 09, 2022 6:01 am
by answerhappygod
Create A Program With A Constructor Function The Program Should Contain The Ff A Distance Class And Constructor Va 1
Create A Program With A Constructor Function The Program Should Contain The Ff A Distance Class And Constructor Va 1 (25.98 KiB) Viewed 26 times
Write a C++ program (in OOP) with the following details:
Create a program with a constructor function. The program should contain the ff: • A Distance class and constructor • Variables for inch and feet • Member function o to get distance to show distance o to add the inputs to subtract the inputs Output: Enter Distance1 : Enter Value of feets: 10 Enter value of inches: 7 Enter Distance2: Enter Value of feets: 15 Enter value of inches: 8 Distance 1 details: Feets : 10 Inches: 7 Distance 2 details: Feets: 15 Inches: 8 Adding two distances : Feets : 26 Inches: 3 Subtracting two distances : Feets: -5 Inches: 1