Please Please Please Help me...

Started by
1 comment, last by RoosterJM 23 years, 11 months ago
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
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
Advertisement
Replace the '',''''s in the cin with ''>>''
------------------------------"My sword is like a menacing cloud, but instead of rain, blood will pour in its path." - Sehabeddin, Turkish Military Commander 1438.
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


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

This topic is closed to new replies.

Advertisement