help new to c++

First my problem is that its not coming out right its coming out .169 but its suppose to be like 5.9
also here are the inputs you have to put in Hours = 1 minutes = 23 First strides 121 Last strides 180 and here is my code





// Pre-compiler directives
#include <iostream>

using namespace std;

// constant declaration
const float FEETperSTRIDE = 2.5;
const float FEETinMILE = 5280;

// Main Program

int main ()
{
// Local Identifiers
int FirstStrides,LastStrides, Hours, Minutes, TotalMinutes;
float TotalStrides, AverageStridesPerMinute, TotalFeet, TotalMiles;


// input module
cout<<"enter the amout of hours you have jogged:\t";
cin>>Hours;
cout<<"enter the amout of minutes you have jogged:\t";
cin>>Minutes;
cout<<"enter the amout of strides in the first minute:\t";
cin>>FirstStrides;
cout<<"enter the amout of stides in the last minute:\t";
cin>>LastStrides;




//computations
AverageStridesPerMinute = (FirstStrides + LastStrides) / 2;
TotalMinutes = (Hours * 60) + Minutes;
TotalStrides = AverageStridesPerMinute * TotalMinutes;
TotalFeet = FEETperSTRIDE * TotalStrides;
TotalMiles = FEETinMILE / TotalFeet ;


// output module
cout<<" you jogged a total of "<<TotalMiles<<" miles"<<endl;


system ("PAUSE");


return 0;



} // end of main
/* program output
Press any key to continue
*/

Doing dimensional analysis on your equation for TotalMiles... You have your fraction flipped.
Topic archived. No new replies allowed.