| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I'm new to c programming and need some help. My problem is to make a program that calculates mileage reimbursement for a truck driver. Rate of payment is .50 cents for every mile. The program is supposed to get information from the user. i.e. mileage. And some things the program is supposed to have are beginning and ending mileage readings, the miles traveled, and the cost per miles traveled; the reimbursement. Please HELP!!!!! what do I do???
|
|
#2
|
||||
|
||||
|
Well, Highlander are you currently reading and learning about C/C++ or do you just want people to give you some examples on ways of how you could do this or what exactly are you asking here. Do you want someone to write that program for you? I guess alls I'm saying is, is that's not a very direct question it is pretty broad, your going to have to narrow this topic down because some one will have to explain to you the whole process of writing a program, as your question stands right now. So any how, let me know either way, and I might be able to help you out. =)..
|
|
#3
|
|||
|
|||
|
reply
I just started reading and now I'm trying this out. If you could give some examples that would be great.
|
|
#4
|
||||
|
||||
|
Well, first off before I get started what compiler are you using and second I will have to do most of my explaining in C++, and third you are going to have to tell me were you are getting stuck at, that way I can help you a little better and in plus this will probably take a bit to write so you are going to have to work along side of me if I'm going to help you.
C++ is basically the super set of C so don't worry anything you write in C will be compatible with C++ but stuff I write in C++ will not be compatible with C unless you add specific libraries, that's why it is important to know what compiler you are using as well as how up to date you libraries are in that compiler. If you don't understand what I'm saying or you don't really know much about your compiler I would suggest downloading Dev C++ so that we will be on the same page. http://bloodshed.net/ Download the latest version and install, don't worry its free ware so no charge and it is a good, easy to use compiler. Any ways I have some other assignments I have to do tonight so I probably wont be able to start this project till tomorrow but I will still be on until later in order to answer any further questions. I would suggest giving me as much details on this subject as you can as far as above and beyond what you have already written if necessary.. |
|
#5
|
||||
|
||||
|
I really, really hope this isn't a HW assignment....
Here's your basic algorithm: - Input starting mileage - Input ending mileage - Calculate mileage driven (end - beginning) - Determine how much money to pay, based on $.50 per mile (mileage * .50) - Input the cost of driving per mile - Determine the total cost of driving (cost * mileage) - Add the cost and the money/wages (cost + wages) Does that make sense?
__________________
Officially a member of the Itsacon fan club. Beer blasts are every friday at Viper_SB's house. I bring the chips. ![]() |
|
#6
|
|||
|
|||
|
I was able to figure it out now... thanks for the help consideration
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > help!!! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|