1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
MatroZZZ [7]
3 years ago
12

Write a function DrivingCost() with input parameters drivenMiles, milesPerGallon, and dollarsPerGallon, that returns the dollar

cost to drive those miles. All items are of type double. If the function is called with 50 20.0 3.1599, the function returns 7.89975. Define that function in a program whose inputs are the car's miles/gallon and the gas dollars/gallon (both doubles). Output the gas cost for 10 miles, 50 miles, and 400 miles, by calling your DrivingCost function three times.
Computers and Technology
1 answer:
posledela3 years ago
4 0

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.

You might be interested in
Why should we be careful about opening email attachments?
quester [9]

Answer:

files can easily infect your computer with viruses or malware.

Explanation:

8 0
3 years ago
Read 2 more answers
When performing the ipconfig command, what does the following output line depict if found in the tunnel adapter settings?
Andrew [12]

Answer:

d. IPv4 Address 192.168.0.4 is associated with the globe IPv6 address 2001:db8:0:10:0:efe

Explanation:

The adapter setting will be associated with the global IP address. When Ipconfig command is operate the IP address finds the relevant domain and then address will use a different subnet. The network will use both IPv4 and IPv6 subnets in order to execute the command.

8 0
2 years ago
29
denis23 [38]

The correct answer is A it transfers control to the next loop in the program.


The most valid answer is that the break statement Exits the loop and continues executing the program, but assuming that there are other loops, the control of the program will go to them since the first loop is broken out of.


3 0
3 years ago
Consider the following list. list = {24, 20, 10, 75, 70, 18, 60, 35} Suppose that list is sorted using the selection sort algori
Nadya [2.5K]

Answer:

list =  {10, 18, 24, 75, 70, 20, 60, 35}

Explanation:

Selection is a sorting algorithm that will set a cursor position and search for a minimum number from the list. When the minimum number is found, that minimum number will be swapped with the number in the cursor position. Only one number will be swapped and sorted in one iteration of outer loop. To sort the next number in the following outer loop iteration, the cursor will be moved to the next position and repeat the same search and swapping process as in the first iteration. When finishing all the iterations of outer loop, all numbers shall be sorted in ascending order.

4 0
3 years ago
What are the purpose of Keyframes,
Kobotan [32]

Answer:

In media production, a key frame or keyframe is a location on a timeline which marks the beginning or end of a transition. It holds special information that defines where a transition should start or stop. The intermediate frames are interpolated over time between those definitions to create the illusion of motion.

Explanation:

7 0
3 years ago
Other questions:
  • You write a short story, but you want to make sure your work is protected before you post it online. What should you do to help
    7·1 answer
  • True or false Rough estimates indicate that point suspension of your driver's license can average anywhere between $3,000+ and $
    10·1 answer
  • python (Business: check ISBN-10) An ISBN-10 (International Standard Book Number) consists of 10 digits: d1d2d3d4d5d6d7d8d9d10. T
    12·1 answer
  • Sandra is having difficulty with her reading assignment because she does not fully understand the language. Which online tool wo
    6·1 answer
  • When in global configuration mode, which steps are necessary to edit an ip address on an Ethernet interface?
    11·1 answer
  • Help!!!
    8·1 answer
  • Why does the peot use a simular pharase at the beggining of each stanza
    8·1 answer
  • Características que debe tener un módulo o kit tecnológico para aprender​
    14·1 answer
  • Testing a website includes visiting every web page on the site and selecting every link, tab, and button available.
    11·1 answer
  • Algorithm to eat orange<br><br>​
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!