Answer:
I believe it is windows 8
Answer:
#include <iostream>
using namespace std;
double DrivingCost(int drivenMiles,double milesPerGallon,double dollarsPerGallon)
{
double dollarsperMile=dollarsPerGallon/milesPerGallon;//calculating dollarsperMile.
return dollarsperMile*drivenMiles;//returning thr driving cost..
}
int main() {
double ans;
int miles;
cout<<"Enter miles"<<endl;
cin>>miles;
ans=DrivingCost(miles,20.0,3.1599);
cout<<ans<<endl;
return 0;
}
Output:-
Enter miles
10
1.57995
Enter miles
50
7.89975
Enter miles
100
15.7995
Explanation:
In the function first I have calculated the dollars per mile and after that I have returned the product of dollarspermile and driven miles.This will give the cost of the Driving.
In a print statement, you can set the End argument to a space or empty string to stop the output from advancing to a new line.
<h3>What is a Print statement?</h3>
A print "statement" is known to be a kind of statement that looks like a call to the make (print) or println process of the System.
Note that In a print statement, you can set the End argument to a space or empty string to stop the output from advancing to a new line so that it can work properly.
Learn more about print statement from
brainly.com/question/25220385
#SJ1