Engineering
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

answer
Answers: 3

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 18:20, yasyyas646646
Agas mixture consists of 8 kmol of h2 and 2 kmol of n2. determine the mass of each gas and the apparent gas constant of the mixture.
Answers: 3
image
Engineering, 04.07.2019 18:20, rhussein6452
Wiy doeres rere okhn a pump whon working betwon the same pressure range?
Answers: 2
image
Engineering, 04.07.2019 19:20, qurreab26
A5 kg block of fe is dropped into a very large vat of water. the fe and water initial temperatures are 95 and 25 c, respectively. the fe final temperature is 25 c and the water can be treated as a thermal reservoir,. treated as a thermal reservoir take the water to be the system and determine the entropy generation. report vour answer in kj/k.
Answers: 1
image
Engineering, 06.07.2019 02:30, onlymyworld27
In a unit cell of fcc structure, indicate the position of one of the tetrahedral interstitial sites by plotting the corresponding tetrahedron. do the same for one of the octahedral interstitial sites (in a separate fcc unit cell). mark the positions of all the tetrahedral and octahedral interstitial sites in the unit cells. how many equivalent tetrahedral sites and how many equivalent octahedral sites are contained in a fcc unit cell, respectively. what is the coordination number for a tetrahedral site and what is the coordination number for an octahedral site?
Answers: 2
Do you know the correct answer?
Write a java program to calculate the miles per gallon for a trip in which a car traveled 2 thousand...

Questions in other subjects:

Konu
Computers and Technology, 28.01.2021 09:40
Konu
Mathematics, 28.01.2021 09:40
Konu
Mathematics, 28.01.2021 09:40
Konu
Mathematics, 28.01.2021 09:40
Konu
Mathematics, 28.01.2021 09:40