Answer:
The answer to this question is option "b".
Explanation:
In the method definition, we perform swapping. To perform swapping we define a variable "temp" that swap values of variable p1 and p2 and store in array that is "values". and other options are not correct that can be defined as:
- In option a, It does not insert any new value in array because we do not pass any value in function.
- In option c, The function does not copy and assign a value in a new array because in this function we not assign any new array.
- In option d, It is incorrect because it can not move an element into high index position.
Answer:
Virtual Machine
Explanation:
<em> I had to look this up, since there were no options from the question. If this is wrong, let me know!</em>
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.
Answer:
By having very good luck and winning it in a giveaway!!!