Ok this is all I need to do....
Write a program to ask the user for odometer readings before and after and gallons of gas used for each of three trips. Calculate the distance and miles per gallon for each trip. Display that information in a report like:
Trip Report
Trip Start End Distance Gallons MPG
1 10078.9 10172.6 93.7 4.65 20.0
2 10364.0 10687.5 323.5 14.90 21.7
3 11538.3 11647.8 109.5 5.34 20.5
If someone could write that for me id be very grateful
Can someone do this quick/easy program for me?
Started by clearsights, Sep 23 2008 09:59 PM
4 replies to this topic
#1
Posted 23 September 2008 - 09:59 PM
|
|
|
#2
Posted 24 September 2008 - 06:03 AM
I'm not going to pump out code for you, else you'd be learning absolutely nothing from us. ;)
All you have to do is created a function:
Then just call that function from your main() function, making sure to include your parameters. It's fairly simple, you should get it really quick. If you can't, do a bit of reading around the web, or come back after you've at least tried to code it, and show us what you've got.
All you have to do is created a function:
float milesPerGallon(float miles, float gallons) {
// ... Your code here.
return yourVar;
}
Then just call that function from your main() function, making sure to include your parameters. It's fairly simple, you should get it really quick. If you can't, do a bit of reading around the web, or come back after you've at least tried to code it, and show us what you've got.
Edited by Steve.L, 24 September 2008 - 06:49 AM.
#3
Posted 24 September 2008 - 06:20 AM
Codecall members will not do your homework for you! The only way to learn how to program is to actually program. Codecall is a community where you can come if you have specific problems that you can't figure out.
I will be happy to help you with specific errors when you post your code :)
I will be happy to help you with specific errors when you post your code :)
#4
Posted 24 September 2008 - 08:15 AM
What part of the assignment are you having issues with?
#5
Guest_Jordan_*
Posted 24 September 2008 - 12:41 PM
Guest_Jordan_*
Why would you not want to learn how to do it yourself? Future homework is only going to get harder and build from this.


Sign In
Create Account

Back to top









