Here is the code:
Code:
#include <stdio.h>
{
main()
//my variable for the program
char firstInitial, middleInitial;
int number_of_pencils;
int number_of_notebooks;
float pencils = 0.23;
float notebooks = 2.89;
float lunchbox = 4.99;
//information for first child
firstInitial = 'J';
middleInitial = 'R';
number_of_pencils= 6;
number_of_notebooks= 4;
printf ("%c%c needs %d pencils, %d notebooks, and 1 lunch box\n", firstInitial, middleInitial, number_of_pencils, number_of_notebooks);
printf("The total cost is $%.2f\n\n", number_of_pencils*pencils + number_of_notebooks*notebooks + lunchbox);
//Information for 2nd child
firstInitial = 'A';
middleInitial = 'J';
number_of_pencils = 10;
number_of_notebooks = 3;
printf("%c%c needs %d pencils, %d notebooks, and 1 lunchbox\n", firstInitial, middleInitial, number_of_pencils*pencils + number_of_notebooks*notebooks" + lunchbox);
//infor for third child
firstInitial = 'M';
middleInitial = 'T';
number_of_pencils = 9;
number_of_notebooks = 2;
printf("%c%c needs %d pencils, %d notebooks, and 1 lunchbox\n", firstInitial, middleInitial, number_of_pencils, number_of_notebooks);
printf("The total cost is $%.2f\n", number_of_pencils*pencils + number_of_notebooks*notebooks + lunchbox);
return 0;
}
Code:
Then here is the error message: error: expected identifier or '(' before '{' token
& second error: missing terminating " character
I'm not sure what the errors are even if they are "included" can't see them. Copied the code exactly from the book and the errors are there. And I had difficulty getting this thread made because of the whole "" thing!