Assignment 2
Error(s): source_file.c: In function ‘main’:
source_file.c:37:11: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[40]’ [-Wformat=]
scanf("%s\n", &studentName);
^
source_file.c:40:11: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[50]’ [-Wformat=]
scanf("%s\n", &courseName);
^
source_file.c:43:11: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[50]’ [-Wformat=]
scanf("%s\n", &professor);
^
source_file.c:49:11: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[40]’ [-Wformat=]
scanf("%s\n", &semester);
^
source_file.c:54:17: error: ‘progAs’ undeclared (first use in this function)
scanf("%f", progAs);
^
source_file.c:54:17: note: each undeclared identifier is reported only once for each function it appears in
source_file.c:55:11: warning: format ‘%f’ expects argument of type ‘float *’, but argument 2 has type ‘double’ [-Wformat=]
scanf("%f", projects);
^
source_file.c:56:11: warning: format ‘%f’ expects argument of type ‘float *’, but argument 2 has type ‘double’ [-Wformat=]
scanf("%f", midTerm);
^
source_file.c:57:11: warning: format ‘%f’ expects argument of type ‘float *’, but argument 2 has type ‘double’ [-Wformat=]
scanf("%f", final);
^
source_file.c:61:5: error: expected ‘;’ before ‘printf’
printf("Final score: %f", score);
^
source_file.c:14:15: warning: unused variable ‘progrAs’ [-Wunused-variable]
float progrAs;
^
source_file.c:13:15: warning: variable ‘score’ set but not used [-Wunused-but-set-variable]
float score;
^
source_file.c:37:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%s\n", &studentName);
^
source_file.c:40:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%s\n", &courseName);
^
source_file.c:43:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%s\n", &professor);
^
source_file.c:46:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d\n", &room);
^
source_file.c:49:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%s\n", &semester);
^
source_file.c:52:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d\n", &year);
^
source_file.c:55:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%f", projects);
^
source_file.c:56:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%f", midTerm);
^
source_file.c:57:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%f", final);
^
|
|