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:10
Burgers vector is generally parallel to the dislocation line. a)-true b)-false
Answers: 2
question
Engineering, 04.07.2019 18:10
A-mn has a cubic structure with a0 0.8931 nm and a density of 7.47 g/cm3. b-mn has a different cubic structure, with a0 0.6326 nm and a density of 7.26 g/cm3. the atomic weight of manganese is 54.938 g/mol and the atomic radius is 0.112 nm. determine the percent volume change that would occur if a-mn transforms to b-mn.
Answers: 2
question
Engineering, 04.07.2019 18:10
Ifa component is made of two or more materials with different modulus of elasticity (e), it is called a composite member and we calculate the factor·n". mention the formula for calculating n". also, ifn> 1, explain what will happen to the 1. transformed.gi) ifn 1, what will happen to the material when transformed material when
Answers: 1
question
Engineering, 04.07.2019 18:10
Awall of 0.5m thickness is to be constructed from a material which has average thermal conductivity of 1.4 w/mk. the wall is to be insulated with a material having an average thermal conductivity of 0.35 w/mk so that heat loss per square meter shall not exceed 1450 w. assume inner wall surface temperature of 1200°c and outer surface temperature of the insulation to be 15°c. calculate the thickness of insulation required.
Answers: 3
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, 26.06.2019 08:00
question
Mathematics, 26.06.2019 08:00
Questions on the website: 13722363