subject
Engineering, 18.09.2019 00:00 bnnn

Write a java program to calculate the miles per gallon for a trip in which a car traveled 2 thousand miles on 120 gallons of gas. the program should print the number of miles travelled, the number of gallons used and the miles per gallon. miles per gallon should be printed as a number containing a decimal point. miles and gallons should both be printed as integers.
be sure to compute the miles per gallon in the program using an arithmetic calculation. the formula for miles per gallon is: miles-per-gallon = miles / gallons include your name and the title of the homework assignment "homework 1") as comments at the top of your program. run your program. your program must run successfully to receive full credit for this homework. take a screenshot of your program similar to the one shown on page 14 of the tools installation tutorial". the screenshot should show all of your source code and the output of your program irn the console window. resize the editor andwor console windows as needed so that everything is shown. you may also need to expand eclipse to full screen size. you can increase the font size in eclipse if needed in case the font size is too small to read on the paper. you can take a screenshot in windows by clicking the print screen" button on the keyboard. next, open microsoft paint (from the accessories menu in the start menu) and click ctrl-v to past the screenshot into paint. save the image as a jpg file. the output of the program should look like below. see if you can figure out how to print the last value with only one digit to the right of the decimal place (not required). hint: look ahead in the textbook for a way to format your output using printf. miles: 2000 gallons: 120 miles per gallon: 16.6

ansver
Answers: 3

Another question on Engineering

question
Engineering, 04.07.2019 18:20
Inadequate stores control is not an obstacle to effective work order system. (clo4) a)-true b)-false
Answers: 3
question
Engineering, 04.07.2019 18:20
Air flows over a heated plate àt a velocity of 50m/s. the local skin factor coefficient at a point on a plate is 0.004. estimate the local heat transfer coefficient at this point.the following property data for air are given: density = 0.88kg/m3 , viscosity 2.286 x 10 ^-5 kgm/s , k = 0.035w/mk ,cp = 1.001kj/kgk. use colburn reynolds analogy.
Answers: 1
question
Engineering, 04.07.2019 19:10
Arigid tank contains 10 kg of air at 137 kpa (abs) and 21°c. more air is added to the tank until the pressure and temperature rise to 242 kpa (abs) and 32°c, respectively. determine the amount of air added to the tank. [r-0.287 kj/kg k]
Answers: 3
question
Engineering, 04.07.2019 19:20
Heat transfer by is the fastest mode of heat transfer that requires no intervening medium. a)-conduction b)-convection c)-radiation d)-conduction and convection
Answers: 1
You know the right answer?
Write a java program to calculate the miles per gallon for a trip in which a car traveled 2 thousand...
Questions
question
Mathematics, 11.11.2020 22:00
question
Mathematics, 11.11.2020 22:00
question
Mathematics, 11.11.2020 22:00
question
Health, 11.11.2020 22:00
Questions on the website: 13722363