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
Arlecino [84]
2 years ago
12

Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats) as input, and output the ga

s cost for 10 miles, 50 miles, and 400 miles.
Ex: If the input is 20.0 3.1599, the output is:

1.57995 7.89975 63.198

Needs to be in Coral language
Computers and Technology
2 answers:
Tems11 [23]2 years ago
8 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:

Ierofanga [76]2 years ago
6 0

Answer:

x^{2} \left[\begin{array}{ccc}1&2&3\\4&5&6\\7&8&9\end{array}\right] \int\limits^a_b {x} \, dx  \lim_{n \to \infty} a_n \sqrt{x} \sqrt[n]{x} \pi \alpha \frac{x}{y} x_{123} \beta

Explanation:

You might be interested in
Which type of security threat installs to a computer without the user's knowledge and then monitors all computer activity?
STatiana [176]
That would be what is known as Spyware, a common form of this is known as a "Trojan Horse". This type of malware is typically latched on and hidden within files, such as when downloading a pirated version of a song, game, art-work, etc...
3 0
3 years ago
Read 2 more answers
The following are part of characteristics of a software requirement specification.
marusya05 [52]

Answer:

should there be 'except' in the question?

6 0
3 years ago
Put these events in the order in which they occurred,
lakkis [162]

Answer:

  1. Local fisherman recover the body of Major Martin off the coast  of Spain .
  2. Spanish officials pass off the information in the briefcase to  German agents.
  3. Major Martin's name appears on a casualty list in a British  newspaper.
  4. Germany prepares for an imminent attack on the island of  Sardinia.

Explanation:

This above is the order in which Operation Mincemeat was executed in WW2 to deceive the Germans into believing that the Allies were going to invade the Balkans directly instead of Sicily which was their actual target.

The plan involved a fictitious Major Martin who had secret documents about the Allied invasion of the Balkans. After the body was released from a British submarine, it washed up in Spain where it was found by local fishermen.

Spanish officials then passed the information in the briefcase Major Martin had to German intelligence. To further reinforce the ruse, the British published Major Martin's name in a casualty list.

The Germans were thoroughly convinced and switched forces from Sicily for the defence of the Balkans and the island of Sicily.

5 0
3 years ago
This form of analysis is an extension of what-if analysis and is the study of the impact on other variables when one variable is
Elenna [48]

Answer: (C) Sensitivity analysis

Explanation:

 The sensitivity analysis is also known as simulation analysis or "What-if" analysis as, it is basically used for the outcome prediction of the decision making in various range of the given variable.

It is used by making a given arrangement of factors, an investigator can decide that how changing in a single variable influence the final result.

The sensitivity analysis is the process for investigation of how the vulnerability in the yield of a scientific model or framework can be isolated in the system.  

Theretofore, Option (C) is correct as all the other options does not involve in the study of variable and also others are not the extension of what-if analysis.

3 0
3 years ago
Write a code segment that takes an emailaddress stored in the string email and stores theuser name in the string user and the ho
iragen [17]

Answer:

#include <bits/stdc++.h>

using namespace std;

int main() {

  string email,username,host;//strings to store email,username,hostname..

  cout<<"Enter the email address "<<endl;

  cin>>email;//taking input of email address..

  bool flag=1;

  for(int i=0;i<email.length();i++)//iterating over the string email..

  {

      if(email[i]=='@')//if @ symbol is encountered make flag 0 skip this iteration.

      {

          flag=0;

          continue;

      }

      if(flag==1)//add to username if flag is 1.

      {

          username+=email[i];

      }

      else//add tom host..

      host+=email[i];

  }

  cout<<"The username is "<<username<<endl<<"The host name is "<<host;//printing the username and hostname..

return 0;

}

Explanation:

I have taken  three strings to store the email address entered by user ,username and host to store username and host name respectively.Then I am iterating over the string email if @ is encountered then skip that iteration before that keep adding characters to username string and after that keep adding characters to host.

8 0
3 years ago
Other questions:
  • 5. What would the browser display if the following code were executed in a script?a var product = 0; while ( product &lt;= 25 );
    8·1 answer
  • In cell h15 enter a vlookup function to determine the 2018 percentage of total attendance for the city listed in cell h14. Use t
    7·1 answer
  • If you've been a victim of identity theft, what should you do after contacting the company that reported the suspicious charge a
    9·1 answer
  • (Analyze scores) Write a program that reads an unspecified number of scores and determines how many scores are above or equal to
    10·1 answer
  • What type of cable would you use to connect two hosts together in a back-to-back configuration using twisted pair cable?
    15·1 answer
  • 1. Some of the music in the 1960s was used to protest social and political issues. Is music still used as a form of protest? Why
    13·1 answer
  • IT professionals should help to protect users’ personal information, such as bank account information or Social Security numbers
    14·1 answer
  • Create a basic program that accomplishes the following requirements: Allows the user to input 2 number , a starting number x and
    12·1 answer
  • In which of the following stages of the development process is a team MOST likely to interview a potential user of an app?
    6·1 answer
  • Jade has to create a workbook for storing information of students participating in the annual state-level sports competition. Th
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!