Hello, well as the title states im pretty new to programming, and I need help with a project I was given in class..
AS you can see I am not done with the bottem yet, only because when I run the program it triggers a Break. As I stated before I am new to this and have no idea whats wrong.
void display (int skateBd, int longBd, int scooter, int ripStick, int bicycle); //Funtion prototypes go here (minimum three user defined functions)
int MostInStock (int skateBd, int longBd, int scooter, int ripStick, int bicycle);
void restock (int skateBd, int longBd, int scooter, int ripStick, int bicycle);
int main ()
int skateBd; //declare 5 variables for the quantities of units (skateboard, longboard, etc.)
skateBd =0; //initialize all 5 variables to 0
FILE *myPtr; //declare pointer to a file
myPtr=fopen("records.txt","r"); //connect to the file
fscanf(myPtr, "%d %d", &id, &qty); //get first pair of numbers from the file
printf("ID is %d, Qty is %d\n", id, qty); //print each pair of numbers on the screen
if (id==1) //do the comparisons witht the id here (use if/ese or switch)
else if (id==2)
else if (id==3)
else if (id==4)
else if (id==5)
fscanf(myPtr, "%d %d", &id, &qty); //get next pair of numbers from the file
fclose(myPtr); //close the file
//call display function
//call mostInStock function
//use if/else or switch here for return id from mostInstock
//call restock function
//function definitions go here (minimum 3 user defined functions)
By now everyone is probly laughing at how easy this looks, but all I can ask is for some help.
Also my teacher gave me this and said to paste it where the source code is found so the file can be found easy.
I just saved it as "records.txt" on notepad and pasted it in the are where the source code was.
The records.txt file
Once again I am a noob and if im not doing any thing right as for posting up something im VERY SORRY.