Originally Posted by
Dave_Sinkula
It seems likely your earlier training used the bastard C/C++ language instead of one or the other. Try
along with
Code:
for ( age = agex; age != 96; age++ )
And don't forget to use the proper format sepcifier:
Code:
scanf ("%d", &agex);
And add this before the end of
main, just for "Be Kind to the OS Day":
yeah I hadnt added the return 0 cuz i'm trying to figure out this program lol, but i will put that in the end, and thx for cataching the "%d"!
I've changed to code to this
Code:
#include <stdio.h>
int main ()
{
int agex, age;
double salaryy;
double savez;
double investw;
// we get all the information we need here
printf ("Enter your birthday\n");
scanf ("%d", &agex);
printf ("Enter your salary\n");
scanf ("%lf", &salaryy);
printf ("What percentage of your salary would you like to put in the cookie jar?\n");
scanf ("%lf", &savez);
printf ("What is the interest rate?\n");
scanf ("%lf", &investw);
for( age = agex; age != 96; age++ )
{
//what now? lol I guess i'll figure that part out when I wake up
}
return 0;
}
teacher also told us to put in user defined functions, but I dont know where to put these (I need to look over and figure out how to write'm anyways)
Your program should have at least three (3) user defined functions with the following prototypes:
void Instruction( );
/* this function displays instructions on how the program works
void DisplayMillionAge( int a);
/*this function takes the age when the user will become a millionaire. */
int GetStartAge( );
/*This function prompts the student for their current age and returns it*/