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]
2 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:
posledela2 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
How many possible password of length four to eight symbols can be formed using English alphabets both upper and lower case (A-Z
Fynjy0 [20]

Answer:

In a password, symbol/characters can be repeated. first calculate the total

symbols which can be used in a password.

So there are total 26(A-Z),26(a-z),10(0-9) and 2(_,$) symbols.

that is equal to 26+26+10+2=64.

Total number of password of length 4:

here at each place can filled in total number of symbols i.e 64 way for each

place.Then total number of possible password is:

64*64*64*64=16777216

Total number of password of length 5:

here at each place can filled in total number of symbols i.e 64 way for each

place.Then total number of possible password is:

64*64*64*64*64=1073741824

Similarly,

Total number of password of length 6:

64*64*64*64*64*64=68719476736

Total number of password of length 7:

64*64*64*64*64*64*64=4398046511104

Total number of password of length 8:

64*64*64*64*64*64*64=281474976710656

Hence the total number of password possible is:285,942,833,217,536

7 0
3 years ago
If you're searching for a date and a product at the same time, you're running a _______ query. A. Complex B. Select C. Parameter
Andrews [41]

If you're searching for a date and a product at the same time, you're running a _______ query. A. Complex B. Select C. Parameter D. Range                                                                                                                                                                                                                                                         A. Complex

6 0
3 years ago
A technically qualified individual who may configure firewalls and IDPSs, implement security software, diagnose and troubleshoot
sineoko [7]

Answer:

Security technician

Explanation:

Security technicians are responsible for fixing, planning, and implementing the IT and computer security system of organisations by making sure the safety and security of the data and information of the clients as well as the employees that make daily use of the systems

Security technicians administer security access to the clients and employees of the organization and are responsible for being up to date with the latest IT security technology developments.

7 0
3 years ago
What has a code that is freely available for use or modification?
liq [111]

Answer:

Open source software

Explanation:

Open source software is exactly what you think it is, the code to compile the software and run it is available to the public for use or modification.

6 0
2 years ago
Dev10 is an Active Directory Domain Services (AD DS) domain member that runs Windows 10 Enterprise.
zubka84 [21]
Do I suppose to answer a question please let me know
8 0
3 years ago
Other questions:
  • In pre-shared key mode, a passphrase should be at least ________ characters long.
    15·1 answer
  • Few people will care if you use their image in a photograph without obtaining their consent. True False
    10·1 answer
  • The ________ multiple-selection PHP statement is used to handle decision making and can be used to replace multiple if and if...
    12·1 answer
  • 1. Write an expression whose value is the result of converting the str value associated with s to an int value. So if s were ass
    12·1 answer
  • A network consists of 10 computers, all running windows 7 professional. one computer acts as a file server and serves up data to
    6·1 answer
  • Which of these would NOT be a valid Internet Control Message Protocol (ICMP) error message:
    6·1 answer
  • What are the names of the four major varnas in the caste system?​
    9·2 answers
  • Which of these is system software? Check all
    14·1 answer
  • Genres are useful for many reaseons. What are some explanations you can think of for how genres can be useful to players, game d
    5·1 answer
  • Write a two to three sentence response to the following question:
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!