Write your question here.
Write TWO CLASSES that help a professor with grading tasks.
The first Class takes information about a test, assignment or exam and save them in a data file. The Class should ask
(a). Course Name,
(b) assignment/test/exam title such as Assignment I or Midterm Exam,
(c) number of students in the class,
(d) each student's name and score on the assignment/test/exam, and
(e) the file name for the data to be saved to.
The second Class takes exam data from a class specified by the user and calculate the class average for that particular test/exam/assignment
Hello, thank you for providing all necessary info to solve the problem. It should be quite easy for us now. From my side, I can give you some tips on how to write first of the classes. The other one follows similar pattern, so you should manage to handle it yourself.
// This is ClassName.h header file - a declaration of ClassName class.
// You start with list of necesary includes
// from libraries (in <>) and your own classes (in "")
#include <necesaryLib1>
#include <necesaryLib2>
#include "DifferentClass.h"
// Then follow with class keyword and it's name.
// Some conventions dictate the class name to start with Capital Letter
// though it is not a requirement.
class ClassName
// Next line is traditionally an opening curly brace
{
// Following lines are usually indented by one tab mark (or four spaces)
// They are ended with semicolon.
// Now use public keyword and put your public members
public:
// Each member has a type, and a name.
// The same convention I mentioned before dictates that
// member names begin with lowercase
// Normally, you would begin with static members, if any:
staticint staticMember;
int memberOne;
int memberTwo;
double memberThree;
// members can be of other class types
DifferentClass memberFour;
// After specifying members, you conventionally would go to present
// member functions or methods.
// Again - by convention, start with public contructor
// or static functions if any
// 0 paratameter contructor, if needed
staticvoid staticMemberFunction();
ClassName();
// Multiparameter constructor may follow
ClassName(int arg1, int arg2);
// Next usually go the other member functions.
// Start with return type, then name then argument list
// by that same convention - lowercase names
int memberFunction ();
double memberFunction2(int arg);
// Once all public member fields and functions are listed
// Proceed to protected fields and methods, then private
protected:
int protectedMember;
int protectedFunction();
private:
int privateMember();
int privateFunction();
// When it is done, close the brace. The class is declared
}
// This is ClassName.cpp file
// It contains definition of functions included in ClassName.h
#include "ClassName.h"
// Define each function including constructors:
ClassName::ClassName()
{
// body of first constructor
}
ClassName:ClassName(int arg1, int arg2)
{
// body of second constructor
}
void ClassName::staticMemberFunction()
{
// body of staticMemberFunction
}
int ClassName::memberFunction()
{
// body of member function
}
/*
other definitions follow
*/
I guess it's all there is to it. Having read that, doing your own homework should be piece of cake.