Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

RoosterJM

Please Please Please Help me...

This topic is 7135 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, this program should be very simple...but for some reason, after i enter in the variables, it just goes into an infinite loop...like it ignores the cin... (i hate these kinds of programs...but its for school, so please, if you can, help me)

// DEFINES //////////////////////////////////////
#define TRUE	1
#define FALSE	0

// INCLUDES /////////////////////////////////////
#include 
#include           /*Screen Clearing*/
#include 

// PROTOTYPES ///////////////////////////////////

int prompt();

void calcStraight(float initial, float residual,
					int years);

void calcSum(float initial, float residual,
			  int years);

void displayData(char, float,
				  float, int);

/** void main() ********************************/
/***********************************************/

void main()
{

	/* VARIABLES */
	float initial = 0.0, residual = 0.0;
	int years = 0;
	char method = 0;
	/* VARIABLES */


int Done = FALSE;  		/* Sentinel */
while( Done != TRUE )
{
// Prompt User
	initial = 0.0;
	residual = 0.0;
	years = 0;
	method = 0;
cout  << "Please Enter Your Information in the following Manner: \n\n"
	  << "[Initial Value] [Residual Value] [Years] [Mehtod (A/S)] \n";
cin   >> initial , residual , years , method;


if (initial == -1.0)	  /* The sentinel control */
{
	Done = TRUE;
	break;
}

/*
if (method == ''A'' // method == ''a'')
{
	calcSum(initial, residual, years);
	Done = FALSE;
}

if (method == ''S'' // method == ''s'')
{
	calcStraight(initial, residual, years);
	Done = FALSE;
}

*/

} // End While

return;
} // End Main

/** void prompt() ******************************/
/***********************************************/

int prompt()
{


} // End prompt()

/** float calcStraight() ***********************/
/***********************************************/

void calcStraight(float initial, float residual,
					int years)
{


return;
} // End calcStraight()

/** float calcSum() ****************************/
/***********************************************/

void calcSum(float initial, float residual,
			  int years)
{


return;
} // End calcSum()

/** void displayData ***************************/
/***********************************************/

void displayData(char method, float initial,
				 float residual, int years)
{


return;
} // End displayData

 
Any help is appreciated...thank you very much... Why does the Air Force need expensive new bombers? Have the people we've been bombing over the years been complaining? -George Wallace To make mistakes is human; to stumble is commonplace; to be able to laugh at yourself is maturity. -William Arthur Ward

Share this post


Link to post
Share on other sites
Advertisement
O - MY - GOD ....

i feel about as dumb as anything right now...

thanks...don''t know why i did that...only been programming for 5 years now...

yeah..im a retard...

thanks...peace

Why does the Air Force need expensive new bombers? Have the people we've been bombing over the years been complaining?
-George Wallace

To make mistakes is human; to stumble is commonplace; to be able to laugh at yourself is maturity.
-William Arthur Ward


Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!