


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



#include
cout<< "Kilometers: "<< km<<endl << "meters:"<< meters<<endl; cout<<"centi meters: "<<cm<<endl; } void add_dist (Road , Road); }; void Road::add_dist(Road d1, Road d2) { meters = d1.meters + d2.meters; km = 0; if(meters >=1000) { meters-=1000; km++; } km += d1.km + d2.km; cm = d1.cm + d2.cm; meters = 0; if(cm >=100) { cm-=100; meters++; } }