Question: Working with the instructor, complete the following programming exercises. Write a program that displays the following information: Your name The city where you were born
Working with the instructor, complete the following programming exercises.
Write a program that displays the following information:
Your name
The city where you were born
Your favorite sports team
Your undergraduate major
A car's miles per gallon MPG can be calculated with the following formula:
MPG Miles driven : Gallons of gas used
Write a program that asks the user for the number of miles driven and the gallons of gas used. It should calculate the car's MPG and display the result.
Show the instructor your work.
Note: To format floating point output with a dollar sign and commas, to two decimal places, use the String class's format method like so:
printThe MPG is $:fformatmpg
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
