Hi,
I am a very new programmer ( 1 month and counting). I am presented with a problem from a tutorial I recieved online and I have no idea how to even start with it. My only assumption is to use array's, but I am not sure how the function protypes are to work and what not. Also, its just plain complicated! (to me at least)
I will write up what I need done, and if you can, give me tips on how and where to start, and what else I can do. It shouldn't be any more than one page of code. Inside the directions for it, I include the most I could come up with as far as psuedocode for it. (I just threw comments in there basically)
Here is the problem:
Calculate the time it takes a Marathoner to travel the distance traveled (provided below). *Of course you must assume that 8 hours is 1 day of travel*
Have the user enter the following (cin):
(7 individual Marathoners)
Marathoners Name
Running Speed
Distance
Elevation gain/loss
The running speed cannot be less than 1 and not greater than 3 (mph). The running speed should be a floating point number (so that "1.5"s can be presented (ie, decimals (sig figures)))
Somehow, create a function to calculate the marathoners's time traveled. The time (in hours) is: distance/running speed.
Create a function to calculate for elevation gain/loss. For every 1000 feet of elevation gain/loss, add one hour to the running time. (elevation gain/loss, is going up and down a hill in essence)
Output (cout) the result of each marathoner to the screen. The Marathoner's name and the time must be separated by a white space.
Preferably the output should be as follows: "Name Time" (ie, Joe 2days, 4hours). Or at least thats how i see it. If you have an opinion on how to make it better let me know!
Also, how does one go about create a data file?
I would like to create a data file called "distance.txt". using the 'marathoner' problem; The file should contain the following on each line, separated by a white space:
marathoners name, running Speed (MPH), distance to travel (miles), elevation gain/loss (feet).
This one I REALLY have no idea how to start out!
If I could recieve some help, that would be great!
Please email me some of the coding, if you can, and don't feel like typing it up to post or whatever (^_^ )
[email protected]
Signed In desperate need of help ,
THE FU FYTER
Addendum: (Tell me if i'm getting anywhere)
#include <iostream.h>
//Function protype...is this correct?
void runnername_array (int *, int);
void main (void)
{
}