Calculates the total cost of gasoline

Assignment Help Other Subject
Reference no: EM13276661

Write a program that calculates the total cost of gasoline. The going rate of gas is $3.40 per gallon. Prompt the user to enter the (1) number of gallons they wish to purchase, and (2) the number of gallons required to fill the tank. You must make sure that the number of gallons requested does not exceed the number of gallons required to fill up the tank, and is greater than zero (use an if statement). The program should output this statement: “It will cost x dollars to fill up n gallons of gasoline at $3.40 per gallon.”

Reference no: EM13276661

Questions Cloud

Management of air quality in smog valley. : Management of Air Quality in Smog Valley. Revisit the example problem from class. Assume that a new ambient air quality standard has been introduced for this pollutant so that the maximum ambient concentration at the cities should not exceed 85 µg/m3..
Determine the rate heat is rejected : A refrigerator, with coils at 28 C operates with a coefficient performance of 4.0 and a power input of 0.8 kW. Heat is rejected from the surrounding air at 20 C. Determine a)the rate heat is rejected(kW), b)the lowest theoretical temp inside the refr..
Identify the major blood vessels associated : Identify the major blood vessels associated with each kidney and trace the path of blood flow through a kidney?
Requests the numeric grades on a midterm and a final exam : rite a program that requests the numeric grades on a midterm and a final exam and then uses a Function procedure to assign a semester grade (A, B, C, D, OR F). The final exam should count twice as much as the midterm exam, the semester average should..
Calculates the total cost of gasoline : Write a program that calculates the total cost of gasoline. The going rate of gas is $3.40 per gallon. Prompt the user to enter the (1) number of gallons they wish to purchase, and (2) the number of gallons required to fill the tank.
Types of oceanic energy source available for harvesting : "What are two most promising types of oceanic energy source available for harvesting?"
What to do about the environment globally : Before we decide what to do about the environment globally, let’s see what we can do locally. What environmental problems are you aware of in the area where you live? What solutions, from among those proposed by the authors of the essays, do you thin..
What is technolgies of hubris and technologies of humility : What is technolgies of Hubris? What is Technologies of Humility?
Grip on the psyche and physical health of girls and women : Whether it is dark, sad eyes of a woman in purdah or the anxious darkly circled eyes of a girl with anorexia nervosa, the woman trapped inside needs to be liberated from cultural confines in whatever form they take.

Reviews

Write a Review

Other Subject Questions & Answers

  During the protostar phase

During the protostar phase, when four hydrogen nuclei are fused together into a single helium nucleus,

  Rank each of the six lunar positions

Rank each of the six lunar positions from left to right based on the amount of the Moon’s illuminated surface that is visible from Earth, from greatest to least

  Politically conservative scientists

Suppose that politically conservative scientists tend to believe that aggression is the result of nature, while more politically liberal scientists believe it is a product of nurture. these differences in beliefs illustrate the need for scientists to..

  Description of rules of inference

Every piece of reasoning must start somewhere. And if every piece of reasoning starts somewhere, then every piece of reasoning begins with an unsupported premise.

  Amicable relations-supreme court decision threatened

Do you think that black southerners would agree with the statement that "amicable relations" had existed between the races for the past ninety years and that the Supreme Court decision threatened to undermine them?

  Discusses the origin of ideas and moves on to some doubts

David Hume discusses "the origin of [our] ideas," and then moves on to some "[skeptical] doubts concerning the operations of the understanding," and finally proposes a "solution of these doubts.

  Epidemic of pediatric obesity

I need some help coming up with a cohesive (a detailed) outline about the epidemic of pediatric obesity. I need to come up with about 7 all-ecompassing topics.

  Avoid violations in terms of environmental issues

Describe how these decisions enable the organization to avoid violations in terms of environmental issues.

  Jane smith tax issues

"Prepare a three page memo to John and Jane Smith addressing whether the issues presented above:

  Input data and output process

Identify at least three processes (capabilities) that are needed in order to keep track of your collection. Identify the input data required for each of the processes.

  Real life case for decision making

Provide three real-life examples of problems for which it would be helpful to go through the problem-solving stages. Discuss your answer to the question concerning this scenario:

  Employers to lay off workers-lower wages and raise prices

advised employers to lay off workers, lower wages, and raise prices. asked businessmen to pledge not to lay off workers but instead to reduce working hours in order to equalize the sacrifice for all employees.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd