Question
C++ question Add a main method to the FeetInches class. The main method should create three FeetInches objects. Create one object named sum_length using the
C++ question
Add a main method to the FeetInches class. The main method should create three FeetInches objects. Create one object named sum_length using the no-parameters constructor. For the other two, prompt the user to enter a number of feet and a number of inches, and construct a FeetInches object using the two parameter constructor. Do this twice, to create the two objects named length1 and length2. Then test the equals method by using it to compare the objects. ALso, test the add method by adding the two lengths length1 and length2 and assiigning the result to the sum_length object. Print the result of the length comparison and print the sum_length. Test the setFeet and setInches methods on sum_length and print it after each set operation to verify it changed properly.
FeetInches Class:
http://cpp.sh/3jhji
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started