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
liraira [26]
3 years ago
10

C++

Computers and Technology
2 answers:
egoroff_w [7]3 years ago
5 0

Answer:

def driving_cost(driven_miles, miles_per_gallon, dollars_per_gallon):

  gallon_used = driven_miles / miles_per_gallon

  cost = gallon_used * dollars_per_gallon  

  return cost  

miles_per_gallon = float(input(""))

dollars_per_gallon = float(input(""))

cost1 = driving_cost(10, miles_per_gallon, dollars_per_gallon)

cost2 = driving_cost(50, miles_per_gallon, dollars_per_gallon)

cost3 = driving_cost(400, miles_per_gallon, dollars_per_gallon)

print("%.2f" % cost1)

print("%.2f" % cost2)

print("%.2f" % cost3)

Explanation:

Cerrena [4.2K]3 years ago
4 0

Answer:

#include <iostream>

#include<iomanip>

using namespace std;

double DrivingCost(double drivenMiles, double milesPerGallon, double dollarsPerGallon)

{

  double dollarCost = 0;

  dollarCost = (dollarsPerGallon * drivenMiles) / milesPerGallon;

  return dollarCost;

}

int main()

{

  double miles = 0;

  double dollars = 0;

  cout << "Enter miles per Gallon   : ";

  cin >> miles;

  cout << "Enter dollars per Gallon: ";

  cin >> dollars;

  cout << fixed << setprecision(2);

  cout << endl;

  cout << "Gas cost for 10 miles : " << DrivingCost(10, miles, dollars) << endl;

  cout << "Gas cost for 50 miles : " <<DrivingCost(50, miles, dollars) << endl;

  cout << "Gas cost for 400 miles: "<<DrivingCost(400, miles, dollars) << endl;

  return 0;

}

Explanation:

  • Create a method definition of DrivingCost that accepts  three input double data type parameters drivenMiles,  milesPerGallon, and dollarsPerGallon and returns  the dollar cost to drive those miles .
  • Calculate total dollar cost and store in the variable, dollarCost .
  • Prompt and read the miles and dollars per gallon  as input from the user .
  • Call the DrivingCost function three times  for the output to the gas cost for 10 miles,  50 miles, and 400 miles.

 

You might be interested in
What are the first two models, e.g. diagrams that affect the entire system, that are built during the CoreProcess to discover an
mrs_skeptik [129]

Answer:

The answer is "Option c and Option d".

Explanation:

A diagram for a case use is a UML dynamic or computational diagram, that is used in the case diagram model. It consists of a set of actions, services, and functions to be carried out by the system. and The class diagram refers to relationships between the UML classes and the source code that dependence, that is two diagrams that affect the system and others are wrong, which can be explained as follows:

  • In option a, It is used for business process, that's is not correct.
  • In option b, It is used for both professionals industry like software and business, that's why it is wrong.
  • In option e, It is used in only high-level language, that's why it is wrong.
  • In option f, It is used to adjust its layout that's why it is wrong.

3 0
4 years ago
Please help me with this!
Aleksandr [31]

def zipZapZop():

   number = int(input("Enter the number: "))

   dictionary = {3: "zip", 5: "zap", 7: "zop"}

   amount = 0<em> #amount of non-divisible numbers by 3, 5 and 7</em>

<em>    for key, value in dictionary.items():</em>

       if(number%key == 0): <em>#key is the number</em>

           print(value) <em>#value can be or zip, or zap, or zop</em>

       else: amount += 1 #the number of "amount" increases every time, when the number is not divisible by 3, or 5, or 7

   if(amount == 3): print(number)    <em>#if the number is not by any of them, then we should print the number</em>

zipZapZop()

4 0
3 years ago
When the PT-109 American patrol boat, under the command of Lieutenant John F. Kennedy, was sunk by a Japanese destroyer, a messa
mr_godi [17]

Answer:

Meaning:

PT BOAT ONE OWE NINE LOST IN ACTION IN BLACKETT  

STRAIT TWO MILES SW MERESU COVE X CREW OF TWELVE  

X REQUEST ANY INFORMATION.

Explanation:

Playfair cipher  invented in 1854 by Charles Wheatstone was the first practical digraph substitution cipher. Lord Playfair promoted the use of the cipher, therefore it was named after him. Playfair cipher encrypts pairs of letters (digraphs) making it hard to break.  Frequency analysis can still be undertaken but requires much more cipher text in order to work. It requires no additional equipment to operate and is very fast therefore it is to protect information during war. It was used  by British forces in the Second Boer War and in World War I and during World War II by the Australians.  

When the PT-109 American patrol boat, under the command of Lieutenant John F. Kennedy, was sunk by a Japanese destroyer, a message was received at an Australian wireless station in the morning of the 2 of August 1943  in Playfair code:

KXJEY  UREBE  ZWEHE  WRYTU  HEYFS  

KREHE  GOYFI  WTTTU  OLKSY  CAJPO  

BOTEI  ZONTX  BYBWT  GONEY  CUZWR  

GDSON  SXBOU  YWRHE  BAAHY  USEDQ

Meaning:

PT BOAT ONE OWE NINE LOST IN ACTION IN BLACKETT  

STRAIT TWO MILES SW MERESU COVE X CREW OF TWELVE  

X REQUEST ANY INFORMATION.

5 0
3 years ago
What are the functions of information technology?
Gekata [30.6K]

There are six basic functions of IT.

1. Capture: Compiling detailed records of activities.

2. Processing: Converting, analyzing, computing and synthesizing all forms of data and information.

3. Generation: Organizing information into a useful form.

4. Storage: Retaining information for further use.

5. Retrieval: Locating and copying stored data or information for further processing or for transmission to another user.

6. Transmission: Distributing information over a communication network.

3 0
2 years ago
The closing of the letter should have at least
asambeis [7]

Answer:

Im unclear exactly what it is saying but i think its 2

7 0
3 years ago
Other questions:
  • Changeover means that ____. (select all that apply)
    7·2 answers
  • Write a function (named n_pointed_star) to make the turtle draw an n-pointed star. The function should return nothing, and accep
    10·1 answer
  • The entrance facility is the place where the connection to a WAN is located. It is basically the point where the LAN begins and
    9·1 answer
  • A student dissolves some solid sodium hydroxide in a beaker of water.
    5·2 answers
  • In a relational database, the three basic operations used to develop useful sets of data are:
    10·1 answer
  • Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binar
    11·1 answer
  • What era was the metalwork from
    10·1 answer
  • Usually written in block style with body text aligned along the left margin
    5·2 answers
  • What is humanity’s greatest invention?
    13·1 answer
  • With which type of satellite is there a propagation delay?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!