Write a main() to test all the functions in the class and follows the user to enter data, and displays the data members that is entered by the user.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter13: Overloading And Templates
Section: Chapter Questions
Problem 22SA
icon
Related questions
Question

1. Create a ‘DISTANCE’ class with the following:- feet (type int) and inches (type float) as data
members. Overloaded stream extraction operator (>>) for input and overload insertion operator
(<<) for output of class data members.
Write a main() to test all the functions in the class and follows the user to enter data, and
displays the data members that is entered by the user. The main() function should display an
appropriate thrown error message if user enter negative distance value from the command
prompt

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning