What's wrong with this code??
Hi,
I wrote this for a CSC 160 level class... Can anyone tell me why I'm getting compiling errors (specifically, why are the functions that use address referencing getting errors)? I can't figure it out for the life of me!
Code:
#include <stdio.h>
void askforlabs();
void askforfinal();
void getlabs(int& lab1, int& lab2, int& lab3, int& lab4, int& lab5, int& lab6, int& lab7, float& labtotal);
void getfinal(float& final);
void display(float number);
void computecourse(float labtotal, float final, float& course);
void askforlabs()
{
printf("Please input the seven lab scores, each separated by a space: ");
}
void askforfinal()
{
printf("\n\nPlease input the final score: ");
}
void getlabs(int& lab1, int& lab2, int& lab3, int& lab4, int& lab5, int& lab6, int& lab7, float& labtotal)
{
scanf("%d %d %d %d %d %d %d", &lab1, &lab2, &lab3, &lab4, &lab5, &lab6, &lab7);
labtotal = (float)(lab1 + lab2 + lab3 + lab4 + lab5 + lab6 + lab7);
labtotal = labtotal * 1.0714;
}
void getfinal(float& final)
{
scanf("%f", &final);
}
void computecourse(float labtotal, float final, float& course)
{
course = labtotal + final;
}
void display(float number)
{
printf("\n%f\n", number);
}
int main()
{
int lab1=-1,lab2=-1,lab3=-1,lab4=-1,lab5=-1,lab6=-1,lab7=-1;
float labtotal=-1;
float final=-1;
float course=-1;
askforlabs();
getlabs(lab1, lab2, lab3, lab4, lab5, lab6, lab7, labtotal);
askforfinal();
getfinal();
computecourse(course);
display(labtotal);
display(final);
display(course);
}
thanks!
-Xanth