Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need help asap as of right now this is the full code and please please please make it correct Fout integers are read from

i need help asap as of right now this is the full code and please please please make it correct
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Fout integers are read from input, where the first two integers are the mles and fent of distancel and the second two mtegers are the mitegand feet of distance2. Define two functors to overload the toperator The first function ovefloads fifo t operator to add two distances. The scoond function overloads the + operator to add a distance and an integer representing the number of mileo Ex if the input is 1317006.530, then the output is 13 miles, 17e0 feet 6 miles, 530 feet Sum: 19 miles, 223e feet 13 miles, 1700 feet 6 miles 5 um: 19 niles, 17ee feet Note. The sum of two distances int - the sum of the number of miles - the sum of the nurber of feet. Nole The sum of a distance and an integer fepresenting the number of miles ist - the surr of the number of mhes and the integer - the number of feet is unchanged 1 kinclude siontreied usine nakiopace staj - class ostance. f. public Distance (int mi =0, int if =0). void Print Q const, oistarce operatori(Distance ris)a ofistance copratori (int, rhs). privates int milesy 13miles,1700feet6milesSum:19miles,1700feet Note: The sum of two distances is: - the surn of the number of miles - the sum of the number of feet Note. The sum of a distance and an integer representing the number of miles is - the surn of the number of miles and the integer - the number of foet is unchanged I/ No need to accormodate for overflow or negotive walues V" Your coul goes here "/ woid oistance: Print ()) const ( 25 cout \&s ailes k- "nlles, " \& feet " leet"; Sum: 19 miles; 2230 feet 13 miles, 1708 feet 6 miles Sum: 19 miles, 17e0 feet Note-The sum of two distances is - the sum of the number of miles - the sum of the number of feet Note. The gurn of a distance and an integer representing the number of miles is: - the sum of the nurtiber of miles and the integer - the number of feet is unchangud Sum: 19 miles, 2238 feet 13 miles, 17ed feet 6 miles. Sun: 19 miles, 1700 feet Note. The sum of two distancesis - thin surn of the number of miles. - the saim of the muitiber of feet. Note. The sum of a distance and an integer representing the number of miles is! - The sum of the mumber of miles and the integor - the number of tect is unchangud

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions