subject

Write a program with a car's miles/gallon and gas dollars/gallon (both floats) as input, and output the gas 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 Note: Small expression differences can yield small floating-point output differences due to computer rounding. Ex: (a + b)/3.0 is the same as a/3.0 + b/3.0 but output may differ slightly. Because our system tests programs by comparing output, please obey the following when writing your expression for this problem. First use the dollars/gallon and miles/gallon values to calculate the dollars/mile. Then use the dollars/mile value to determine the cost per 10, 50, and 400 miles. Note: Real per-mile cost would also include maintenance and depreciation.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:20
Write a program called assignment3 (saved in a file assignment3.java) that computes the greatest common divisor of two given integers. one of the oldest numerical algorithms was described by the greek mathematician, euclid, in 300 b.c. it is a simple but very e↵ective algorithm that computes the greatest common divisor of two given integers. for instance, given integers 24 and 18, the greatest common divisor is 6, because 6 is the largest integer that divides evenly into both 24 and 18. we will denote the greatest common divisor of x and y as gcd(x, y). the algorithm is based on the clever idea that the gcd(x, y) = gcd(x ! y, y) if x > = y and gcd(x, y) = gcd(x, y ! x) if x < y. the algorithm consists of a series of steps (loop iterations) where the “larger” integer is replaced by the di↵erence of the larger and smaller integer. this continues until the two values are equal. that is then the gcd.
Answers: 3
question
Computers and Technology, 22.06.2019 15:30
In a compound condition, both conditions on either side of the logical operator and must be true for the overall condition to be true. a: true b: false
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
If joey was single and his taxable income was $9,500, how much would he pay in taxes each year?
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
For a typical middle-income family, what is the estimated cost of raising a child to the age of 18? $145,500 $245,340 $304,340 $455,500
Answers: 1
You know the right answer?
Write a program with a car's miles/gallon and gas dollars/gallon (both floats) as input, and output...
Questions
question
Mathematics, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01
question
History, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01
question
Mathematics, 17.09.2020 07:01
question
Mathematics, 17.09.2020 07:01
question
Mathematics, 17.09.2020 07:01
question
Mathematics, 17.09.2020 07:01
question
Mathematics, 17.09.2020 07:01
question
Mathematics, 17.09.2020 07:01
question
Mathematics, 17.09.2020 07:01
question
Mathematics, 17.09.2020 07:01
question
Mathematics, 17.09.2020 07:01
question
Mathematics, 17.09.2020 07:01
Questions on the website: 13722367