Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I. let's we have a class named Distance having two private data members such as feet(integer), inches(float), one input function to input values to
I. let's we have a class named Distance having two private data members such as feet(integer), inches(float), one input function to input values to the data members, one Display function to show the distance. The distance 5 feet and 6.4 inches should be displayed as 5'- 6.4". Then add the two objects of Distance class and then display the result (the + operator should be overloaded). You should also take care of inches if it's more than 12 then the inches should be decremented by 12 and feet to be incremented by 1. II. Write a program to print the following details Assign and print the ID of each employee, Phone number and Address of two staff members having names 'ali" and "asif" respectively by creating two objects of the class 'Employee'. throw an exception in case the phone number of employee is inserted in float , double or char value. throw an exception in case the ID of an employee is inserted in float , double or char value.
Step by Step Solution
★★★★★
3.37 Rating (166 Votes )
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