Write a program that calculates the total cost of gasoline

Assignment Help Basic Computer Science
Reference no: EM13308075

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: EM13308075

Questions Cloud

What is the magnitude of the current through the wire : A wire runs through a 0.7 T magnetic field as shown. The dashed lines represent the magnetic field, and the solid black line the wire. What is the magnitude of the current through the wire
Find the heat transfer from a steady-flow combustor : Find the heat transfer (in KJ/Kmol)from a steady-flow combustor if the products are at 1000 K and (a) complete combustion occurs; (b) 95% of the carbon is converted to CO2 and 5% to CO.
Threatening market share : Recent entry of private label brand competition is threatening market share and changing long-term relationships between these major brands.
Obtain the energy of the emitted photon : A hydrogen atom initially in the n=3 level emits a proton and ends up in the ground state. what must the energy of this photon be and What is the energy of the emitted photon
Write a program that calculates the total cost of gasoline : Write a program that calculates the total cost of gasoline.
What is the output of the following program : What is the output of the following program?
Write a sequence of statements that creates a new file : There are two text files, whose names are given by two String variables , file1 and file2. These text files have the same number of lines. Write a sequence of statements that creates a new file whose name consists concatenating the names of the tw..
How should joe respond to bill''s invitation : How should Joe respond to Bill's invitation?
Explain how a set of points maximizes the minimum angle : Prove that the smallest angle of any triangulation of a convex polygon whose vertices lie on a circle is the same. This implies that any completion of the Delaunay triangulation of a set of points maximizes the minimum angle.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Design a class named location for locating a maximal value

Design a class named Location for locating a maximal value and its location in a two-dimensional array.

  People and organization responsible for bumping problems

Answer from the perspective of the airlines and from the perspective of the customers. What people, organization, and technology factors are responsible for excessive bumping problems?"

  How many times each integer was generated

Initialize each item in the second array to 0. For each item in the first array, use it as the index into the second array and increment the contents found in the second array at the corresponding index.

  Make an instance of romannumerals

Make an instance of RomanNumerals and invoke the method toRoman(int n). Enter a number in the Arabic notation and it will convert it to a Roman numeral. For example 17 will be converted to XVII.You will notice a test suite that we provide with the..

  Show even-parity encoding of bit string in form of bytes

Show the even-parity encoding of the following bit string, in the form of bytes: 0100101011101011101010110110 (break it up into pieces of data large enough to encode as several parity-encoded bytes.

  Write piece of code uses a loop to compute and precending

The Fibonacci numbers are a sequence of integers in which the first two elements are 1, and each following element is the sum of the two preceding elements

  What would programs have to do for each type of hardware

If an applications' requests for data did not go through the OS, what would programs have to do for each type of hardware?

  Explain functionality of multiprogrammed system in user mode

In multiprogrammed system, must this functionality be available in user mode or only accessible by system call? Why or why not?

  Write a program that prompts a salesman

Write a program that prompts a salesman to enter his/her status and total sales. Compute/display the following: their status; total sales; commission rate applied; the commission ($) earned (the appropriate rate times the sales).

  Can be done with primary keys

Explain what can be done with primary keys to eliminate key ripple effects as a database evolves.

  Use mcnaughton''s wrap around rule

Use McNaughton's wrap around rule to construct a preemptive

  Write an appropriate me expression capturing the essence

Write an appropriate ME expression capturing the essence

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