Answer:
Written in C++
double read_double(string prompt) {
cout<<prompt;
double num;
cin>>num;
return num;
}
Explanation:
This line defines the function
double read_double(string prompt) {
This line displays the passed string
cout<<prompt;
This line declares a double variable
double num;
This line gets the input
cin>>num;
This line returns the input
return num;
}
See attachment for full program