-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRef.h
More file actions
41 lines (36 loc) · 1.31 KB
/
Ref.h
File metadata and controls
41 lines (36 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Class Ref
// Computer Science, MVNU
//
// Ref is a class for representing a Bible reference consisting of
// * integer book - the book from 1 (Genesis) to 66 (Revalation)
// * integer chap - the chapter number >1
// * integer verse - he verse numner >1
//
#ifndef Ref_H
#define Ref_H
#include <string>
#include <stdlib.h>
using namespace std;
// GetNextToken returns a token from str, which contains all characters
// up to the first character from delimiters
string GetNextToken(string& str, const string& delimiters);
class Ref {
private:
short book, chap, verse; // Reference information
public:
Ref(); // Default constructor
Ref(string s); // Parse constructor - example parameter "43:3:16"
Ref(const int,const int,const int); // Construct from three integers;
// Accessors
int getBook(); // Access book number
int getChap(); // Access chapter number
int getVerse(); // Access verse number
// REQUIRED Comparison: determine if two references are equal
bool operator==(const Ref);
// OPTIONAL: < and > comparisons for Ref objects might also be useful
// REQUIRED: Display the reference on cout, example output: John 3:16
void display(const int vNum);
// Your version of display should show the book name
// corresponding to the stored book number.
};
#endif //Ref_H