Question
/ Program Distance converts either yards or feet to // a record of type Distance. //***************************************************** #include using namespace std; struct Distance { long feet;
/ Program Distance converts either yards or feet to // a record of type Distance. //*****************************************************
#include
struct Distance { long feet; long yards; long miles; };
Distance ConvertYards(long yards); // Post: yards has been converted into a variable of // type Distance.
Distance ConvertFeet(long feet); // Post: feet has been converted into a variable of // type Distance.
void PrintDistance(Distance distance); // Post: A vriable of type Distance is printed as feet, // yards, and miles.
int main() { // FILL IN code to test the operations involving // struct Distance. }
//********* Distance Operations ********************
Distance ConvertYards(long yards) { // FILL IN Code to convert yards to a variable of Distance. }
//******************************************************
Distance ConvertFeet(long feet) { // FILL IN Code to convert feet to a variable of Distance. }
//******************************************************
void PrintDistance(Distance Distance) { // FILL IN Code to print a variable of Distance. }
Fill in the mising code in these operations involving struct Distance.
Fill in the missing code in function main that test the operations with the data used in the discription of the operations. Describe any bugs
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