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.
Scripting languages are unique computer languages because they automate task that could be done by human operator and are easy to use.
<h3>What is a scripting language?</h3>
Scripting languages are programming languages that is interpreted.
They are programming languages that automates the task that will originally be performed by a human operator.
Scripting languages are used to give instruction to other software to run accordingly to how you want it.
The scripting language is different form other language base on the fact that its interpreted . This means the code are translated to machine code when it is run.
The major advantage of scripting languages is that it is human readable and understandable.
Examples of scripting languages are Python and JavaScript.
learn more on scripting here: brainly.com/question/12763341
#SPJ1
Answer:
Following are the code in the PHP Programming Language:
<u>foreach ($country_codes as $code => $name) {
</u>
Explanation:
The following option is true because the Foreach statement only works on the objects and array and this statement is good for accessing the key and value pairs from the array.
So, that's why to print following associative array through echo statement we use the Foreach loop statement with following right condition.
<u>syntax</u>:
foreach (array as value)
{
code or body to execute;
}
Answer: "hierarchy" .
_____________________________________________________