Hey I have a homework assignment that seemed to be going well but then i got stuck. Here is the assignment
WProgram Description:
Write a program to generate a report based on input received from a text file. Suppose the input text file student_status.txt contains the student’s name (lastName, firstName middleName), id, number of credits earned as follows :
Doe, John K.
3460 25
Andrews, Susan S.
3987 72
Monroe, Marylin
2298 87
Gaston, Arthur C.
2894 110
Generate the output in the following format :
John K. Doe 3460 25 Freshman
Susan S. Andrews 3987 40 Sophomore
Marylin Monroe 2298 87 Junior
Arthur C. Gaston 2894 110 Senior
The program must be written to use the enum class_level :
The function deriveClassLevel should derive the class_level of the student based on the number of credits earned.
The first namespace globalType tys should derive the class level based on a two year school policy.
and the second namespace globalType fys should derive the class level based on a four year school policy.
So I basically did it in parts and got everything working and then had to make the namespace so I had this:
cout << name << " " << id << " " << noc << " " << uplevel << endl;
}
system("pause");
return 0;
}
I know I have to clean it up and change it but it ran like it was suppose to. Then I tried adding the global namespaces and I this:
#include <iostream>
#include <fstream>
#include <string>
system("pause");
return 0;
}
}
}
with this i keep getting an error saying tys::deriveClassLevel: must return a value and tys::fys::deriveClassLevel: must return a value. I have been messing around with this part and struggling I thought I used the namespace to run the if statements with the criteria for the years of school. Basically I have been stuck for awhile and trying to change things around but I cant seem to get it to work. If anyone could help me get past this road block I would greatly appericate it since I dont have class till Tuesday and I dont want to wait that long for help.
You forgot to put return classLevel; at the end of those functions. When you tell your compiler that a function is going to return something, it expects you to return it.