cppHomework/Exam.h

47 lines
963 B
C++

#pragma once
#include<algorithm>
#include<fstream>
#include<iomanip>
#include<iostream>
#include<string>
#include<vector>
#include"Item.h"
using namespace std;
struct Examsave {
int studentnum;
char name[100];
char filename[100];
};
class Exam {
public:
Exam(Examsave* insave);
Exam(char inname[]);
void saveAll(ofstream& examsout);
void addItem(long long int studentNo, double score[9]);
void addItem(const Item& item);
bool rmvItem(long long int studentNo);
static void dspHeader();
void dsp() const;
void dspName() const;
void dspName(int w) const;
void dspItems() const;
void toCsvItems(ofstream& csv) const;
bool itemExists(long long int studentNo) const;
void changeName(char name[]);
const Item* StudentInquiry(long long int studentNo) const;
int getStuRanking(const Item& item);
void rm() const;
virtual ~Exam(){};
private:
vector<Item> items;
struct Examsave save;
int studentnum;
char name[100];
char filename[100];
};