In this project, you will:
The Wikipedia entry for Trivia provides some interesting background on the origin of the commonly used question and answer sessions and games. Trivialities, bits of information of little consequence, was the title of a popular book by British aphorist Logan Pearsall Smith (1865-1946), first published in 1902 but popularized in 1918 It consisted of short essays often tied to observation of small things and commonplace moments. Trivia is the plural of trivium, "a public place." The adjectival form of this, trivialis, was hence translated by Smith as "commonplace."
In the 1918 version of his book Trivia, Smith wrote:
I KNOW too much; I have stuffed too many of the facts of History and Science into my intellectuals. My eyes have grown dim over books; believing in geological periods, cave dwellers, Chinese Dynasties, and the fixed stars has prematurely aged me.
In the 1960s, nostalgic college students and others began to informally trade questions and answers about the popular culture of their youth. The first known documented labeling of this casual parlor game as "Trivia" was in a Columbia Daily Spectator column published on February 5, 1965. The author, Ed Goodgold, then started the first organized "trivia contests" with the help of Dan Carlinsky. Ed and Dan wrote the book Trivia (Dell, 1966), which achieved a ranking on the New York Times best-seller list; the book was an extension of the pair's Columbia contests and was followed by other Goodgold and Carlinsky trivia titles. Trivia, they wrote, "is concerned with tugging at heartstrings," while minutiae deal with such unevocative questions as "Which state is the largest consumer of Jell-O?" But over the years the word has come to refer to obscure and arcane bits of dry knowledge as well as nostalgic remembrances of pop culture.[citation needed] The board game Trivial Pursuit was released in 1982 and was a craze in the U.S. for several years thereafter (Wikipedia, 2022).
Figure 1. Playing Trivial Pursuit: see image.
For this project, we will be implementing a tool for reading in questions that require answers to be in a variety of different data types including doubles, ints, or strings. There are three classes for this project. The questions class will hold the information about each individual question including the subject, data type, question, answer, and if it has been answered yet. The trivia class manages the questions, the menu, the scoring, and the game itself. This project requires a special data structure, an Lqueue, that we are going to build using a linked list. The Lqueue is a templated data structure that is designed to handle most types of data which is first-in, first-out (FIFO).
Class 1 - Lqueue
This is a very important class. It is used to hold the questions for trivia. It uses a linked list to store the information about whatever it is designed to hold (in this case questions that have int answers, questions that have double answers, or questions that have string answers). As a linked list, it uses templated nodes to store data. For this project, the data in every node must be private. You will need to implement normal queue functions such as Push (which inserts in the end), Pop (which removes from front), Display (which displays data in each node), Front (which returns the first element in the queue), Find(which searches the queue for a specific value), and Clear (which removes all nodes from the lqueue). Finally, you must implement the copy constructor and assignment operator in this class. There should be absolutely NO references to questions or trivia in the Lqueue class.
There is an extra file provided called lqueue_test.cpp that is used to test some of the key functions in Lqueue. You should try and complete Lqueue.cpp before starting on any of the other functions. To test Lqueue, use make lqueue then make test (both included in the makefile) and it will run your compilation and testing for Lqueue.
Class 2: Question
This is a templated class that holds all of the information about a question. Questions are templated and can be used to answer questions that are integers, doubles, and strings (although we could make char, floats or anything else). The trivia project will use an Lqueue to hold all of the questions for a game of trivia. Input files will have different subjects.
Class 3: Trivia
This class includes most of the key functions and manages most of the game. It is called directly from proj5.cpp. LoadFile reads a data file (which is passed in as an argument) such as proj5_string.txt and populates the m_questions Lqueue. The MainMenu function manages the game. It keeps running as long as the player doesn't enter quit.
The player can choose a specific subject and then the Trivia class will iterate over all questions in that subject. The answers that the user enter will be checked to see if they are correct and it will immediately indicate if the answer is correct or not.
Once all of the questions in a subject have been answered, the user is told how many they got correct, incorrect, and the percentage correct (rounded to the closest percent). All answers should be lower case. It should then return to the main menu.
This is a list of the requirements of this application. For you to earn all the points you will need to meet all the defined requirements.
To start with the testing of the Lqueue file, you can alternate writing functions (starting with the constructor and Push). Here is a simple run showing what it looks like when the player does 1, 2, and 3.
make string
./proj5 proj5_string.txt string
Welcome to UMBC Trivia!
Choose an option.
1. Display Subjects
2. Start Subject
3. Quit
1
Possible Subjects:
1. Science & Nature
2. General
3. Food & Drink
4. Entertainment
5. History & Holidays
6. Geography
7. Sports & Leisure
Choose an option.
1. Display Subjects
2. Start Subject
3. Quit
2
What subject would you like to attempt?
Possible Subjects:
1. Science & Nature
2. General
3. Food & Drink
4. Entertainment
5. History & Holidays
6. Geography
7. Sports & Leisure
7
There are 1 questions in this subject.
1. Question: Which Country Hosted The Olympic Games In 2004?
Please answer with a(n) string.
greece
Correct
You got 1 answers correct.
You got 0 answers incorrect.
Which is a 100%.
Choose an option.
1. Display Subjects
2. Start Subject
3. Quit
3
Thank you trying UMBC Trivia!
This shows a complete run doing the addition problems for a double.
[jdixon@linux2 proj5]$ make double1
valgrind ./proj5 proj5_double.txt double
==326329== Memcheck, a memory error detector
==326329== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==326329== Using Valgrind-3.17.0 and LibVEX; rerun with -h for copyright info
==326329== Command: ./proj5 proj5_double.txt double
==326329==
Welcome to UMBC Trivia!
Choose an option.
1. Display Subjects
2. Start Subject
3. Quit
1
Possible Subjects:
1. Addition
2. Subtraction
3. Multiplication
4. Division
Choose an option.
1. Display Subjects
2. Start Subject
3. Quit
2
What subject would you like to attempt?
Possible Subjects:
1. Addition
2. Subtraction
3. Multiplication
4. Division
1
There are 7 questions in this subject.
1. Question: 63.12+8.7
Please answer with a(n) double.
71.82
Correct
2. Question: 51.91+18.62
Please answer with a(n) double.
70.53
Correct
3. Question: 86.79+22.15
Please answer with a(n) double.
108.94
Correct
4. Question: 89.32+39.83
Please answer with a(n) double.
124.44
Incorrect
5. Question: 83.05+22.4
Please answer with a(n) double.
105.45
Correct
6. Question: 52.73+38.22
Please answer with a(n) double.
90.95
Correct
7. Question: 97.1+47
Please answer with a(n) double.
134.1
Incorrect
You got 5 answers correct.
You got 2 answers incorrect.
Which is a 71.4286%.
Choose an option.
1. Display Subjects
2. Start Subject
3. Quit
0
Please enter a valid
Choose an option.
1. Display Subjects
2. Start Subject
3. Quit
4
Please enter a valid option.
Choose an option.
1. Display Subjects
2. Start Subject
3. Quit
3
Thank you trying UMBC Trivia!
==326329==
==326329== HEAP SUMMARY:
==326329== in use at exit: 0 bytes in 0 blocks
==326329== total heap usage: 106 allocs, 106 frees, 89,584 bytes allocated
==326329==
==326329== All heap blocks were freed -- no leaks are possible
==326329==
==326329== For lists of detected and suppressed errors, rerun with: -s
==326329== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Lqueue.cpp
#ifndef LQUEUE_CPP
#define LQUEUE_CPP
#include < string >
#include < iostream >
#include < iomanip >
#include < cmath >
using namespace std;
//Templated node class used in templated linked list
template < class T >
class Node {
public:
Node( const T& data ); //Constructor
T& GetData(); //Gets data from node
void SetData( const T& data ); //Sets data in node
Node< T >* GetNext(); //Gets next pointer
void SetNext( Node< T >* next ); //Sets next pointer
private:
T m_data;
Node< T >* m_next;
};
//Overloaded constructor for Node
template < class T >
Node< T >::Node( const T& data ) {
m_data = data;
m_next = NULL;
}
//Returns the data from a Node
template < class T >
T& Node< T >::GetData() {
return m_data;
}
//Sets the data in a Node
template < class T >
void Node< T >::SetData( const T& data ) {
m_data = data;
}
//Gets the pointer to the next Node
template < class T >
Node< T >* Node< T >::GetNext() {
return m_next;
}
//Sets the next Node
template < class T >
void Node< T >::SetNext( Node< T >* next ) {
m_next = next;
}
template < class T >
class Lqueue {
public:
// Name: Lqueue() (Linked List Queue) - Default Constructor
// Desc: Used to build a new linked queue (as a linked list)
// Preconditions: None
// Postconditions: Creates a new lqueue where m_head and m_tail point to nullptr
// Required
Lqueue();
// Name: ~Lqueue() - Destructor
// Desc: Used to destruct a Lqueue
// Preconditions: There is an existing lqueue with at least one node
// Postconditions: An lqueue is deallocated (including dynamically allocated nodes)
// to have no memory leaks!
// Required
~Lqueue();
// Name: Lqueue (Copy Constructor)
// Preconditions: Creates a copy of existing LQueue
// Requires a Lqueue
// Postconditions: Copy of existing Lqueue
// Required
Lqueue(const Lqueue&);
// Name: operator= (Overloaded Assignment Operator)
// Preconditions: Copies an Lqueue into an existing Lqueue
// Requires a Lqueue
// Postconditions: Copy of existing Lqueue
// Required
Lqueue< T >& operator= (Lqueue&);
// Name: Push
// Preconditions: Takes in data. Creates new node.
// Requires a Lqueue
// Postconditions: Adds a new node to the end of the lqueue.
// Required
void Push(const T&);
// Name: Pop
// Preconditions: Lqueue with at least one node.
// Postconditions: Removes first node in the lqueue, returns data from first node.
// Required
T Pop();
// Name: Display
// Preconditions: Outputs the lqueue.
// Postconditions: Displays the data in each node of lqueue
// Required (used only for testing)
void Display();
// Name: Front
// Preconditions: Requires a populated lqueue
// Postconditions: Returns whatever data is in front
// Required
T Front();
// Name: IsEmpty
// Preconditions: Requires a lqueue
// Postconditions: Returns if the lqueue is empty.
// Required
bool IsEmpty();
// Name: GetSize
// Preconditions: Requires a lqueue
// Postconditions: Returns m_size
// Required
int GetSize();
// Name: Find()
// Preconditions: Requires a lqueue
// Postconditions: Iterates and if it finds the thing, returns index, else -1
// Required
int Find(T&);
// Name: Swap(int)
// Preconditions: Requires a lqueue
// Postconditions: Swaps the nodes at the index with the node prior to it.
// Required
void Swap(int);
// Name: Clear
// Preconditions: Requires a lqueue
// Postconditions: Removes all nodes in a lqueue
// Required
void Clear();
// Name: At
// Precondition: Existing Lqueue
// Postcondition: Returns object from Lqueue at a specific location
// Desc: Iterates to node x and returns data from Lqueue
// Required
T At (int x);
private:
Node < T > *m_head; //Node pointer for the head
Node < T > *m_tail; //Node pointer for the tail
int m_size; //Number of nodes in queue
};
//**********Implement Lqueue Class Here***********
//**********All Functions Are Required Even If Not Used for Trivia**************
#endif
lqueue_test.cpp
#include < iostream >
#include < string >
using namespace std;
#include "Lqueue.cpp"
// To test just queue follow these instructions:
// 1. make ttest
int main () {
//Test 1 - Default Constructor and Push
cout << "Test 1 - Default Constructor and Push Running" << endl;
int test1 = 10;
int test2 = 20;
int test3 = 30;
//Test Default Constructor
Lqueue < int > *newLQ1 = new Lqueue < int >();
//Push 4 nodes into Lqueue
newLQ1- >Push(test1);
newLQ1- >Push(test2);
newLQ1- >Push(test3);
cout << "After 3 Pushs size: " << newLQ1- >GetSize() << endl;
newLQ1- >Display();
cout << "End Test 1 - Constructor and Push" << endl << endl;
//Test 2 - Copy Constructor and Assignment Operator
cout << "Test 2 - Copy Constructor Running" << endl;
//Test Copy constructor
Lqueue < int > *newLQ2 = new Lqueue < int >(*newLQ1);
newLQ2- >Display();
cout << "size below should match. Location should not" << endl;
cout << "Source size: " << newLQ1- >GetSize() << " and Copied size: " << newLQ2- >GetSize() << endl;
cout << "Source location: " << &newLQ1 << " and Copied location: " << &newLQ2 << endl;
cout << "End Test 2 - Copy" << endl << endl;
//Test 3 - Overloaded Assignment Operator
cout << "Test 3 - Overloaded Assignment Operator Running" << endl;
//Create new Lqueue using constructor
Lqueue < int > *newLQ3 = new Lqueue < int >();
//Update using overloaded assignment operator
*newLQ3 = *newLQ1;
newLQ3- >Display(); //Display contents of newLQ3
cout << "size below should match. Location should not" << endl;
cout << "Source size: " << newLQ1- >GetSize() << " and Assigned size: " << newLQ3- >GetSize() << endl;
cout << "Source location: " << &newLQ1 << " and Assigned location: " << &newLQ3 << endl;
cout << "End Test 3 - Assignment" << endl << endl;
//Test 4 - Test Pop
cout << "Test 4 - Pop" << endl;
cout << "size before: " << newLQ1- >GetSize() << " ";
newLQ1- >Pop();
cout << "size after: " << newLQ1- >GetSize() << endl;
cout << "End Test 4 - Pop" << endl << endl;
//Test 5 - Test size and Clear
cout << "Test 5 - size and Clear Running" << endl;
//Test size()
cout << "Outputting the size" << endl;
cout << newLQ2- >GetSize() << endl;
//Test Clear()
cout << "Clearing all nodes" << endl;
newLQ2- >Clear();
cout << "Outputting the size (should now be 0)" << endl;
cout << newLQ2- >GetSize() << endl;
cout << endl;
//Test 6 - Test Find
cout << "Test 6 - Find" << endl;
cout << "Try to find 10 (Should NOT find it)" << endl;
if(newLQ1- >Find(test1) != -1){
cout << "10 Found" << endl;
}else{
cout << "10 NOT Found" << endl;
}
cout << "Try to find 20 (Should find it)" << endl;
if(newLQ1- >Find(test2) != -1){
cout << "20 Found" << endl << endl;
}else{
cout << "20 NOT Found" << endl << endl;
}
//Test 7 - Test Destructor
cout << "Test 7 - Test Destructor" << endl;
cout << "delete newLQ1" << endl;
delete newLQ1;
cout << "delete newLQ2" << endl;
delete newLQ2;
cout << "delete newLQ3" << endl;
delete newLQ3;
cout << "End Test 6 - Destructors" << endl;
return 0;
}
makefile
CXX = g++
CXXFLAGS = -Wall -g
IODIR =../../proj5_IO/
proj5: Question.o Lqueue.o Trivia.o proj5.cpp
$(CXX) $(CXXFLAGS) Trivia.o Question.o Lqueue.cpp proj5.cpp -o proj5
Trivia.o: Trivia.cpp Lqueue.o Question.o
$(CXX) $(CXXFLAGS) -c Trivia.cpp
Lqueue.o: Lqueue.cpp
$(CXX) $(CXXFLAGS) -c Lqueue.cpp
Question.o: Question.cpp
$(CXX) $(CXXFLAGS) -c Question.cpp
clean:
rm *.o*
rm *~
string:
./proj5 proj5_string.txt string
string1:
valgrind ./proj5 proj5_string.txt string
int:
./proj5 proj5_int.txt int
int1:
valgrind ./proj5 proj5_int.txt int
double:
./proj5 proj5_double.txt double
double1:
valgrind ./proj5 proj5_double.txt double
lqueue:
g++ -Wall lqueue_test.cpp Lqueue.cpp -o lqueue_test
test:
valgrind ./lqueue_test
submit:
cp Lqueue.cpp Trivia.cpp Question.cpp proj5.cpp ~/cs202proj/proj5
##Used for grading and testing
copy:
cp $(IODIR)tf* .
tf1:
g++ -Wall tf_test.cpp Lqueue.cpp -o tf_test
tf2:
valgrind ./tf_test
tf3:
valgrind ./proj5 proj5_data.txt
proj5.cpp
// Include basic io functions, strings, and the trivia class
#include < iostream >
#include < string >
#include "Trivia.cpp"
#include "Lqueue.cpp"
using namespace std;
// Global constant for maximum subjects
int main(int argc, char**argv) {
const int EXPECTED_ARGS = 3;
const int FILENAME = 1;
const int DATATYPE = 2;
string filename = DEFAULT_FILE;
string datatype = argv[DATATYPE];
//Usage ./proj5 [FILENAME] [DATATYPE]
if (argc == EXPECTED_ARGS) { //Compares count of arguments vs EXPECTED_ARGS
filename = argv[FILENAME]; //Pull filename from arguments
if (datatype == "int") { //If datatype = "int" creates a new trivia object (int)
Trivia< int >* newTrivia = new Trivia< int >(argv[FILENAME]);
delete newTrivia;
}
else if (datatype == "double") {
Trivia< double >* newTrivia = new Trivia< double >(argv[FILENAME]);
delete newTrivia;
}
else if (datatype == "string") {
Trivia< string >* newTrivia = new Trivia< string >(argv[FILENAME]);
delete newTrivia;
}else{
cout << "Invalid data type" << endl;
}
}
else {
cout << "ERROR: Expected usage is ./proj5 [FILENAME] [DATATYPE]" << endl;
return -1;
}
return 0;
}
proj5_double.txt
Addition|63.12+8.7|double|2|71.82
Subtraction|55.54-49.89|double|4|5.65
Multiplication|87.94*17.68|double|3|1554.77
Division|73.4/49.08|double|2|1.49
Addition|51.91+18.62|double|5|70.53
Subtraction|93.95-47.62|double|5|46.33
Multiplication|86.95*46.55|double|2|4047.52
Division|92.97/20.13|double|2|4.62
Addition|86.79+22.15|double|5|108.94
Subtraction|99.95-8.26|double|4|91.69
Multiplication|81.45*16.96|double|3|1381.39
Division|55.31/42.63|double|2|1.30
Addition|89.32+39.83|double|2|129.15
Subtraction|82.33-31.61|double|1|50.72
Multiplication|50.04*25.56|double|4|1279.02
Division|98/37.78|double|2|2.59
Addition|83.05+22.4|double|1|105.45
Subtraction|82.53-6.36|double|2|76.17
Multiplication|86.03*10.67|double|4|917.94
Division|77.32/15.74|double|2|4.91
Addition|52.73+38.22|double|2|90.95
Subtraction|73.86-50.43|double|5|23.43
Multiplication|71.22*2.02|double|3|143.86
Division|54.07/41.26|double|1|1.31
Addition|97.1+47|double|1|144.1
Subtraction|91.29-27.2|double|4|64.09
Multiplication|98.03*4.04|double|4|396.04
Division|59.18/1.27|double|3|46.60
proj5_double2.txt
Addition|63.12+8.7|double|2|71.82
Subtraction|55.54-49.89|double|4|5.65
Multiplication|87.94*17.68|double|3|1554.7792
Division|73.4/49.08|double|2|1.49551752241239
Modulus|70.98%36.76|double|4|34.22
Addition|51.91+18.62|double|5|70.53
Subtraction|93.95-47.62|double|5|46.33
Multiplication|86.95*46.55|double|2|4047.5225
Division|92.97/20.13|double|2|4.61847988077496
Modulus|98.61%33.51|double|5|31.59
Addition|86.79+22.15|double|5|108.94
Subtraction|99.95-8.26|double|4|91.69
Multiplication|81.45*16.96|double|3|1381.392
Division|55.31/42.63|double|2|1.29744311517711
Modulus|76.36%25.46|double|2|25.44
Addition|89.32+39.83|double|2|129.15
Subtraction|82.33-31.61|double|1|50.72
Multiplication|50.04*25.56|double|4|1279.0224
Division|98/37.78|double|2|2.59396506087877
Modulus|69.34%36.89|double|4|32.45
Addition|83.05+22.4|double|1|105.45
Subtraction|82.53-6.36|double|2|76.17
Multiplication|86.03*10.67|double|4|917.9401
Division|77.32/15.74|double|2|4.91232528589581
Modulus|92.01%26.3|double|1|13.11
Addition|52.73+38.22|double|2|90.95
Subtraction|73.86-50.43|double|5|23.43
Multiplication|71.22*2.02|double|3|143.8644
Division|54.07/41.26|double|1|1.31047018904508
Modulus|61.65%19.42|double|1|3.38999999999999
Addition|97.1+47|double|1|144.1
Subtraction|91.29-27.2|double|4|64.09
Multiplication|98.03*4.04|double|4|396.0412
Division|59.18/1.27|double|3|46.5984251968504
Modulus|54.55%42.6|double|2|11.95
Addition|56.23+9.39|double|4|65.62
Subtraction|50.85-30.84|double|4|20.01
Multiplication|67.53*39.96|double|1|2698.4988
Division|99.54/7.6|double|4|13.0973684210526
Modulus|86.64%17.74|double|3|15.68
Addition|91.63+4.34|double|5|95.97
Subtraction|76.42-6.02|double|4|70.4
Multiplication|67.31*28.58|double|4|1923.7198
Division|92.96/45.74|double|4|2.03235679930039
Modulus|98.88%49.08|double|2|0.719999999999999
Addition|60.68+12.24|double|5|72.92
Subtraction|62-19.13|double|5|42.87
Multiplication|64.88*29.38|double|1|1906.1744
Division|52.22/15.93|double|2|3.27809165097301
Modulus|53.04%1.49|double|1|0.889999999999999
Addition|55.59+47.27|double|2|102.86
Subtraction|51.41-22.42|double|1|28.99
Multiplication|80.77*34.98|double|4|2825.3346
Division|55.67/50.18|double|2|1.10940613790355
Modulus|72.96%40.57|double|3|32.39
Addition|78.01+42.86|double|2|120.87
Subtraction|57.61-48.63|double|4|8.98
Multiplication|86.6*10.36|double|2|897.176
Division|65.83/1.63|double|1|40.3865030674847
Modulus|93.81%13.75|double|3|11.31
Addition|75.78+25.16|double|5|100.94
Subtraction|58.45-24.85|double|1|33.6
Multiplication|66.93*50.84|double|2|3402.7212
Division|86.13/34.68|double|3|2.48356401384083
Modulus|78.17%49.63|double|2|28.54
Addition|76.13+2.96|double|4|79.09
Subtraction|52.43-26.74|double|2|25.69
Multiplication|59.22*10.78|double|2|638.3916
Division|74.77/14.77|double|3|5.062288422478
Modulus|90.93%12.99|double|2|5.32907051820075E-15
Addition|64.25+18.51|double|5|82.76
Subtraction|91.39-8.71|double|5|82.68
Multiplication|73.43*12.84|double|3|942.8412
Division|67.65/5.26|double|1|12.861216730038
Modulus|55.16%45.67|double|3|9.48999999999999
Addition|58.99+44.9|double|5|103.89
Subtraction|96.74-26.28|double|1|70.46
Multiplication|81.61*47.07|double|1|3841.3827
Division|100/24.86|double|3|4.02252614641995
Modulus|59.19%2.06|double|4|1.51
Addition|99.72+28.73|double|3|128.45
Subtraction|69.07-50.94|double|3|18.13
Multiplication|92.59*9.16|double|5|848.1244
Division|85.18/25.24|double|3|3.37480190174327
Modulus|89.72%3.13|double|4|2.08
Addition|63.42+38.64|double|2|102.06
Subtraction|84.04-38.69|double|4|45.35
Multiplication|90.85*27.36|double|4|2485.656
Division|50.2/38.2|double|4|1.31413612565445
Modulus|51.72%31.25|double|4|20.47
Addition|92.76+31.54|double|5|124.3
Subtraction|60.83-30.06|double|5|30.77
Multiplication|88.51*7.66|double|4|677.9866
Division|58.49/30.05|double|3|1.94642262895175
Modulus|84.43%38.2|double|4|8.03
Addition|69.94+3.83|double|1|73.77
Subtraction|52.45-5.73|double|4|46.72
Multiplication|57.71*11.12|double|5|641.7352
Division|73.47/7.23|double|2|10.1618257261411
Modulus|92.73%1.26|double|2|0.750000000000003
Addition|73.3+8.74|double|2|82.04
Subtraction|57.27-33.95|double|5|23.32
Multiplication|69.47*36.35|double|3|2525.2345
Division|57.23/22.06|double|3|2.59428830462375
Modulus|76.96%16.76|double|3|9.91999999999999
Addition|54.92+11.86|double|3|66.78
Subtraction|63.02-11.06|double|2|51.96
Multiplication|56.8*2.11|double|1|119.848
Division|68.41/8.22|double|3|8.32238442822384
Modulus|86.06%33.7|double|1|18.66
Addition|73.96+18.24|double|4|92.2
Subtraction|76.65-22.29|double|5|54.36
Multiplication|62.2*27.16|double|1|1689.352
Division|59.35/42.56|double|3|1.39450187969925
Modulus|54.4%29.26|double|5|25.14
Addition|73.42+13.97|double|5|87.39
Subtraction|74.08-29.22|double|3|44.86
Multiplication|60.56*16.09|double|5|974.4104
Division|53.32/22.77|double|4|2.34167764602547
Modulus|60.21%26.97|double|2|6.27
Addition|83.78+41.62|double|2|125.4
Subtraction|96.29-3.21|double|5|93.08
Multiplication|55.62*15.73|double|3|874.9026
Division|87.1/1.4|double|4|62.2142857142857
Modulus|96.53%2.76|double|4|2.69000000000001
Addition|59.38+28.69|double|1|88.07
Subtraction|58.81-10.73|double|3|48.08
Multiplication|100.43*37.75|double|1|3791.2325
Division|71.22/35.61|double|2|2
Modulus|72.69%49.56|double|4|23.13
Addition|100.02+35.53|double|5|135.55
Subtraction|52.74-12.27|double|3|40.47
Multiplication|50.99*5.75|double|4|293.1925
Division|98.78/1.14|double|3|86.6491228070175
Modulus|82.47%46.26|double|1|36.21
Addition|89+11.51|double|2|100.51
Subtraction|54.12-15.66|double|3|38.46
Multiplication|93.32*8.87|double|5|827.7484
Division|95.91/25.8|double|1|3.71744186046512
Modulus|67.97%2.09|double|2|1.09
Addition|82+41.34|double|3|123.34
Subtraction|66.62-13.57|double|2|53.05
Multiplication|66.55*44.55|double|5|2964.8025
Division|68.53/47.47|double|3|1.44364862018117
Modulus|69.03%2.08|double|5|0.389999999999999
Addition|60.45+17.93|double|4|78.38
Subtraction|81.95-22.2|double|3|59.75
Multiplication|87.84*11.45|double|3|1005.768
Division|80.53/27.92|double|3|2.88431232091691
Modulus|93.94%11.29|double|1|3.62
Addition|82.74+19.43|double|4|102.17
Subtraction|97.27-46.66|double|1|50.61
Multiplication|58.11*10.54|double|2|612.4794
Division|98.1/32.61|double|4|3.00827966881325
Modulus|60.92%45.09|double|5|15.83
Addition|83.24+7.43|double|2|90.67
Subtraction|54.72-43.4|double|2|11.32
Multiplication|61.03*19.95|double|3|1217.5485
Division|79.61/39.02|double|3|2.04023577652486
Modulus|82.56%23.81|double|1|11.13
Addition|62.25+2.72|double|2|64.97
Subtraction|94.24-20.22|double|2|74.02
Multiplication|50.05*14|double|5|700.7
Division|76.08/11.6|double|4|6.55862068965517
Modulus|97.93%32.32|double|5|0.970000000000006
Addition|58.06+21.4|double|5|79.46
Subtraction|59.8-35.71|double|2|24.09
Multiplication|60.86*9.51|double|3|578.7786
Division|70.11/4.91|double|1|14.2790224032587
Modulus|79%10.93|double|2|2.49
Addition|90.65+44.26|double|4|134.91
Subtraction|94.8-47.78|double|5|47.02
Multiplication|50.88*43.9|double|4|2233.632
Division|71.01/41.92|double|2|1.69394083969466
Modulus|61.15%22.24|double|1|16.67
Addition|100.5+30.54|double|4|131.04
Subtraction|69.16-36.41|double|2|32.75
Multiplication|72.38*16.32|double|3|1181.2416
Division|53.21/43.8|double|4|1.2148401826484
Modulus|58.18%33.67|double|3|24.51
Addition|86.77+49.73|double|2|136.5
Subtraction|53.76-39.93|double|3|13.83
Multiplication|96.99*20.55|double|1|1993.1445
Division|96.68/1.77|double|5|54.6214689265537
Modulus|59.67%22.18|double|1|15.31
Addition|72.76+33.56|double|5|106.32
Subtraction|63.68-31.34|double|2|32.34
Multiplication|83.55*6.92|double|5|578.166
Division|59.43/40.75|double|2|1.45840490797546
Modulus|80.47%40.6|double|4|39.87
Addition|68.23+28.96|double|1|97.19
Subtraction|67.79-35.41|double|4|32.38
Multiplication|53.5*37.51|double|3|2006.785
Division|80.51/26.33|double|2|3.05772882643373
Modulus|77.18%28.17|double|3|20.84
Addition|78.12+6.59|double|3|84.71
Subtraction|89.33-6.67|double|2|82.66
Multiplication|73.97*20.18|double|1|1492.7146
Division|75.76/49.48|double|3|1.53112368633791
Modulus|60.17%23.99|double|3|12.19
Addition|84.92+47.44|double|4|132.36
Subtraction|51.39-46.8|double|2|4.59
Multiplication|75.89*21.63|double|5|1641.5007
Division|50.48/12.29|double|5|4.10740439381611
Modulus|95.88%47.77|double|3|0.339999999999989
Addition|100.53+18.39|double|4|118.92
Subtraction|88.03-50.41|double|5|37.62
Multiplication|69.43*47.12|double|5|3271.5416
Division|68.49/15.7|double|5|4.36242038216561
Modulus|63.61%37.68|double|3|25.93
Addition|52.27+32.78|double|1|85.05
Subtraction|64.99-25.1|double|3|39.89
Multiplication|84.37*9.33|double|3|787.1721
Division|96.54/32.03|double|2|3.01404932875429
Modulus|78.4%34.86|double|2|8.68000000000001
Addition|54.99+12.73|double|3|67.72
Subtraction|79.74-32.11|double|5|47.63
Multiplication|100.97*14.23|double|2|1436.8031
Division|52.11/48.06|double|2|1.08426966292135
Modulus|59.64%49.64|double|3|10
Addition|93.11+7.43|double|3|100.54
Subtraction|88.01-15.15|double|5|72.86
Multiplication|96.47*10.21|double|5|984.9587
Division|54.53/37.44|double|2|1.45646367521368
Modulus|68.04%2.7|double|4|0.540000000000002
Addition|64.86+28|double|4|92.86
Subtraction|86.45-16.43|double|1|70.02
Multiplication|85.6*29.63|double|3|2536.328
Division|97.2/43.88|double|3|2.2151321786691
Modulus|76.13%28.33|double|3|19.47
Addition|78.8+12.96|double|1|91.76
Subtraction|87-40.44|double|5|46.56
Multiplication|64.99*6.89|double|4|447.7811
Division|51.66/45.15|double|3|1.14418604651163
Modulus|69.56%49.7|double|2|19.86
Addition|56.31+47|double|3|103.31
Subtraction|91.07-16.32|double|3|74.75
Multiplication|55.98*9.73|double|2|544.6854
Division|92.13/33.53|double|4|2.74768863704146
Modulus|52.18%34.61|double|1|17.57
Addition|94.82+3.45|double|5|98.27
Subtraction|96.85-32.47|double|4|64.38
Multiplication|79.1*1.81|double|1|143.171
Division|88.58/28.24|double|2|3.13668555240793
Modulus|65.48%38.55|double|5|26.93
Addition|58.16+29.15|double|1|87.31
Subtraction|77.82-17.92|double|4|59.9
Multiplication|65.4*4.6|double|2|300.84
Division|75.35/7.62|double|5|9.88845144356955
Modulus|83.36%35.19|double|1|12.98
Addition|95.54+18.52|double|1|114.06
Subtraction|95.88-41.09|double|4|54.79
Multiplication|74.38*26.36|double|1|1960.6568
Division|79.65/12.61|double|2|6.31641554321967
Modulus|68.43%47.12|double|3|21.31
Addition|60.54+48.17|double|2|108.71
Subtraction|71.97-11.64|double|4|60.33
Multiplication|51.01*10.3|double|5|525.403
Division|59.14/24.27|double|3|2.43675319324269
Modulus|78.18%2.51|double|4|0.370000000000013
Addition|92.5+3.43|double|3|95.93
Subtraction|54.82-12.58|double|5|42.24
Multiplication|53.2*16.86|double|2|896.952
Division|79.97/23.07|double|5|3.46640658864326
Modulus|73.52%48.16|double|5|25.36
Addition|82.56+39.5|double|5|122.06
Subtraction|92.5-30.23|double|3|62.27
Multiplication|101*4.42|double|5|446.42
Division|62.34/38.97|double|1|1.59969207082371
Modulus|100.1%35.24|double|1|29.62
Addition|53.32+40.47|double|3|93.79
Subtraction|61.22-23.29|double|3|37.93
Multiplication|56.47*7.03|double|5|396.9841
Division|91.41/39.04|double|5|2.34144467213115
Modulus|73.07%41.65|double|5|31.42
Addition|93.77+11.37|double|1|105.14
Subtraction|71.97-22.65|double|4|49.32
Multiplication|93.75*14.16|double|5|1327.5
Division|64.04/20.18|double|3|3.17343904856293
Modulus|100.46%34|double|2|32.46
Addition|97.76+15.81|double|4|113.57
Subtraction|85.08-26.2|double|3|58.88
Multiplication|63.36*31.63|double|5|2004.0768
Division|51.67/13.51|double|3|3.82457438934123
Modulus|89.37%21.29|double|4|4.21000000000001
Addition|50.68+18.44|double|4|69.12
Subtraction|77.53-45.29|double|3|32.24
Multiplication|73.58*9.46|double|4|696.0668
Division|65.02/49.37|double|4|1.31699412598744
Modulus|82.85%47.36|double|1|35.49
Addition|91.56+5.01|double|4|96.57
Subtraction|92.28-42.29|double|5|49.99
Multiplication|80.09*8.74|double|1|699.9866
Division|78.95/12.03|double|4|6.56275976724855
Modulus|51.94%33.63|double|4|18.31
Addition|64.07+6.48|double|1|70.55
Subtraction|88.92-29.25|double|4|59.67
Multiplication|69.76*27.57|double|3|1923.2832
Division|99.12/1.87|double|2|53.0053475935829
Modulus|94.98%24.68|double|5|20.94
proj5_int.txt
Addition|51+30|int|4|81
Subtraction|70-16|int|3|54
Multiplication|77*21|int|4|1617
Division|86/41|int|3|2
Modulus|61%20|int|1|1
Addition|61+19|int|4|80
Subtraction|63-50|int|4|13
Multiplication|75*40|int|5|3000
Division|76/13|int|5|5
Modulus|82%20|int|2|2
Addition|56+40|int|3|96
Subtraction|80-48|int|5|32
Multiplication|56*34|int|2|1904
Division|53/32|int|5|1
Modulus|92%47|int|2|45
Addition|91+10|int|1|101
Subtraction|83-3|int|3|80
Multiplication|80*8|int|5|640
Division|81/27|int|3|3
Modulus|72%2|int|2|0
Addition|96+43|int|5|139
Subtraction|100-50|int|3|50
Multiplication|54*9|int|5|486
Division|50/15|int|3|3
Modulus|64%37|int|5|27
Addition|72+48|int|5|120
Subtraction|65-34|int|2|31
Multiplication|87*5|int|3|435
Division|78/3|int|4|26
Modulus|96%22|int|1|8
Addition|85+35|int|5|120
Subtraction|76-20|int|3|56
Multiplication|73*47|int|5|3431
Division|83/32|int|3|2
Modulus|64%46|int|1|18
Addition|59+45|int|3|104
Subtraction|99-40|int|1|59
Multiplication|84*12|int|5|1008
Division|89/17|int|3|5
Modulus|88%10|int|5|8
Addition|83+42|int|4|125
Subtraction|95-48|int|3|47
Multiplication|98*37|int|1|3626
Division|80/8|int|5|10
Modulus|53%14|int|1|11
Addition|91+49|int|1|140
Subtraction|97-35|int|2|62
Multiplication|97*34|int|4|3298
Division|90/47|int|1|1
Modulus|77%43|int|1|34
Addition|58+38|int|5|96
Subtraction|96-7|int|3|89
Multiplication|64*18|int|3|1152
Division|82/20|int|1|4
Modulus|85%8|int|4|5
Addition|88+30|int|2|118
Subtraction|89-23|int|2|66
Multiplication|61*31|int|5|1891
Division|99/45|int|5|2
Modulus|100%21|int|5|16
Addition|80+3|int|3|83
Subtraction|53-34|int|1|19
Multiplication|65*11|int|3|715
Division|98/28|int|1|3
Modulus|71%18|int|2|17
Addition|62+18|int|2|80
Subtraction|74-30|int|5|44
Multiplication|59*41|int|2|2419
Division|61/33|int|4|1
Modulus|56%36|int|4|20
Addition|63+29|int|3|92
Subtraction|83-48|int|5|35
Multiplication|54*13|int|5|702
Division|77/19|int|3|4
Modulus|91%4|int|5|3
Addition|56+50|int|5|106
Subtraction|64-50|int|1|14
Multiplication|92*38|int|4|3496
Division|66/14|int|4|4
Modulus|72%31|int|2|10
Addition|54+21|int|1|75
Subtraction|83-41|int|2|42
Multiplication|72*8|int|5|576
Division|68/25|int|1|2
Modulus|94%30|int|2|4
Addition|91+11|int|5|102
Subtraction|65-30|int|3|35
Multiplication|57*38|int|5|2166
Division|92/1|int|4|92
Modulus|94%6|int|3|4
Addition|52+25|int|3|77
Subtraction|75-3|int|5|72
Multiplication|72*45|int|3|3240
Division|58/28|int|5|2
Modulus|81%3|int|1|0
Addition|98+31|int|5|129
Subtraction|99-27|int|2|72
Multiplication|82*40|int|3|3280
Division|82/27|int|5|3
Modulus|63%11|int|1|8
Addition|93+6|int|5|99
Subtraction|69-31|int|2|38
Multiplication|90*27|int|4|2430
Division|89/24|int|4|3
Modulus|81%34|int|3|13
Addition|88+26|int|4|114
Subtraction|91-37|int|5|54
Multiplication|97*43|int|3|4171
Division|91/3|int|1|30
Modulus|82%35|int|3|12
Addition|62+37|int|4|99
Subtraction|67-45|int|1|22
Multiplication|88*16|int|5|1408
Division|95/21|int|4|4
Modulus|57%41|int|3|16
Addition|92+16|int|5|108
Subtraction|98-29|int|2|69
Multiplication|79*23|int|5|1817
Division|72/8|int|3|9
Modulus|73%24|int|5|1
Addition|82+30|int|1|112
Subtraction|84-3|int|3|81
Multiplication|68*38|int|1|2584
Division|66/7|int|5|9
Modulus|89%43|int|1|3
Addition|86+14|int|2|100
Subtraction|63-7|int|2|56
Multiplication|83*3|int|5|249
Division|90/24|int|1|3
Modulus|56%9|int|2|2
Addition|69+42|int|1|111
Subtraction|80-34|int|1|46
Multiplication|83*44|int|2|3652
Division|91/12|int|4|7
Modulus|93%34|int|4|25
Addition|66+1|int|5|67
Subtraction|58-26|int|3|32
Multiplication|52*29|int|1|1508
Division|59/33|int|5|1
Modulus|98%48|int|2|2
Addition|84+18|int|4|102
Subtraction|71-17|int|3|54
Multiplication|96*6|int|2|576
Division|55/37|int|5|1
Modulus|60%2|int|2|0
Addition|98+31|int|4|129
Subtraction|100-6|int|4|94
Multiplication|74*30|int|4|2220
Division|74/25|int|4|2
Modulus|71%19|int|1|14
Addition|56+18|int|4|74
Subtraction|50-25|int|4|25
Multiplication|79*3|int|3|237
Division|98/44|int|4|2
Modulus|84%11|int|1|7
Addition|58+21|int|4|79
Subtraction|59-33|int|2|26
Multiplication|54*19|int|5|1026
Division|90/24|int|3|3
Modulus|92%13|int|2|1
Addition|66+50|int|1|116
Subtraction|87-38|int|1|49
Multiplication|50*44|int|5|2200
Division|91/19|int|1|4
Modulus|77%26|int|3|25
Addition|67+23|int|5|90
Subtraction|55-46|int|1|9
Multiplication|92*45|int|2|4140
Division|81/45|int|3|1
Modulus|83%29|int|1|25
Addition|51+23|int|5|74
Subtraction|52-18|int|5|34
Multiplication|86*50|int|1|4300
Division|50/23|int|1|2
Modulus|77%49|int|2|28
Addition|100+22|int|5|122
Subtraction|60-10|int|1|50
Multiplication|92*43|int|5|3956
Division|59/27|int|4|2
Modulus|92%21|int|2|8
Addition|72+42|int|3|114
Subtraction|99-40|int|4|59
Multiplication|99*50|int|2|4950
Division|77/16|int|3|4
Modulus|92%28|int|3|8
Addition|81+22|int|5|103
Subtraction|61-30|int|5|31
Multiplication|80*30|int|2|2400
Division|78/13|int|1|6
Modulus|88%31|int|4|26
Addition|60+1|int|5|61
Subtraction|90-27|int|1|63
Multiplication|94*6|int|4|564
Division|69/20|int|1|3
Modulus|55%14|int|2|13
Addition|92+14|int|5|106
Subtraction|94-39|int|1|55
Multiplication|80*43|int|5|3440
Division|99/30|int|1|3
Modulus|82%40|int|5|2
Addition|62+44|int|2|106
Subtraction|72-38|int|2|34
Multiplication|59*17|int|5|1003
Division|72/32|int|3|2
Modulus|52%24|int|2|4
Addition|74+45|int|4|119
Subtraction|86-32|int|4|54
Multiplication|76*18|int|1|1368
Division|60/33|int|5|1
Modulus|100%27|int|4|19
Addition|81+47|int|3|128
Subtraction|63-10|int|2|53
Multiplication|96*45|int|2|4320
Division|57/36|int|4|1
Modulus|92%43|int|3|6
Addition|68+47|int|4|115
Subtraction|66-24|int|4|42
Multiplication|76*5|int|3|380
Division|56/35|int|1|1
Modulus|54%27|int|5|0
Addition|58+21|int|1|79
Subtraction|88-23|int|4|65
Multiplication|97*5|int|2|485
Division|52/7|int|4|7
Modulus|88%33|int|1|22
Addition|84+18|int|3|102
Subtraction|84-26|int|5|58
Multiplication|90*11|int|2|990
Division|50/15|int|4|3
Modulus|53%34|int|2|19
Addition|57+11|int|2|68
Subtraction|55-16|int|1|39
Multiplication|53*30|int|4|1590
Division|58/5|int|1|11
Modulus|82%3|int|4|1
Addition|84+9|int|1|93
Subtraction|63-18|int|5|45
Multiplication|71*46|int|4|3266
Division|85/20|int|3|4
Modulus|75%18|int|2|3
Addition|69+23|int|3|92
Subtraction|87-18|int|4|69
Multiplication|66*34|int|2|2244
Division|99/27|int|3|3
Modulus|66%6|int|3|0
Addition|79+3|int|1|82
Subtraction|95-23|int|5|72
Multiplication|72*40|int|2|2880
Division|98/39|int|5|2
Modulus|72%9|int|5|0
Addition|68+17|int|1|85
Subtraction|91-6|int|2|85
Multiplication|54*44|int|2|2376
Division|70/11|int|4|6
Modulus|53%47|int|4|6
Addition|75+9|int|1|84
Subtraction|75-41|int|4|34
Multiplication|82*32|int|3|2624
Division|77/7|int|1|11
Modulus|80%43|int|2|37
Addition|69+35|int|3|104
Subtraction|81-30|int|4|51
Multiplication|98*32|int|3|3136
Division|69/19|int|4|3
Modulus|99%35|int|4|29
Addition|79+6|int|3|85
Subtraction|73-42|int|2|31
Multiplication|82*3|int|5|246
Division|53/32|int|2|1
Modulus|77%8|int|1|5
Addition|91+38|int|2|129
Subtraction|70-7|int|5|63
Multiplication|78*3|int|3|234
Division|62/47|int|4|1
Modulus|84%23|int|4|15
Addition|68+27|int|1|95
Subtraction|90-10|int|1|80
Multiplication|99*24|int|2|2376
Division|73/15|int|5|4
Modulus|83%32|int|4|19
Addition|64+1|int|3|65
Subtraction|90-45|int|4|45
Multiplication|81*30|int|2|2430
Division|57/42|int|3|1
Modulus|87%7|int|5|3
Addition|100+18|int|2|118
Subtraction|62-7|int|5|55
Multiplication|81*8|int|3|648
Division|77/21|int|1|3
Modulus|95%33|int|3|29
Addition|97+26|int|1|123
Subtraction|67-19|int|2|48
Multiplication|97*10|int|4|970
Division|83/4|int|5|20
Modulus|82%8|int|4|2
Addition|75+13|int|4|88
Subtraction|68-48|int|2|20
Multiplication|63*23|int|1|1449
Division|96/36|int|2|2
Modulus|56%37|int|4|19
proj5_string.txt
Science & Nature|What does the first w in "www" stand for in a website browser?|string|1|world
General|What geometric shape is generally used for stop signs?|string|1|octagon
General|What is the name of the biggest technology company in South Korea?|string|2|samsung
Science & Nature|Who was the first woman to win a Nobel Prize in 1903 (last name)?|string|3|curie
Food & Drink|What is the name given to Indian food cooked over charcoal in a clay oven?|string|3|tandoori
Food & Drink|What is the most consumed manufactured drink in the world?|string|2|tea
Entertainment|Who created Sherlock Holmes? (last name)|string|2|doyle
Science & Nature|What Is The Study Of Low Temperatures Called?|string|3|cryogenics
History & Holidays|What English city was known to the Romans as Venta Bulgarum?|string|5|winchester
Science & Nature|What is the symbol for iron in chemistry?|string|5|fe
Entertainment|Which member of the Beatles married Yoko Ono? (last name)|string|2|lennon
Geography|What is the capital of North Carolina?|string|4|raleigh
Entertainment|What job was Sting before he was a rock star?|string|5|teacher
General|What is compressed snow also called?|string|4|neve
General|Adolph Hitler had what type of phobia?|string|3|claustrophobia
Entertainment|What famous US festival hosted over 350,000 fans in 1969?|string|3|woodstock
General|In the Bible, who is the Book of Proverbs attributed to?|string|2|solomon
General|Who kept searching for his long lost salt shaker? (Last Name)|string|2|buffet
General| The feeling of having experienced something before is known as _______? (one word)|string|1|Dejavu
History & Holidays|What was the leading cause of death in the late 19th century?|string|2|tuberculosis
General|Who was the first novelist to present a typed manuscript to his publisher? (last name)|string|5|twain
Science & Nature| Despite man's fear and hatred of the wolf, it has not ever been proved that a non_rabid wolf ever attacked a __________?|string|5|human
Science & Nature|What does the L in LPG stands for?|string|4|liquid
General|What school does Harry Potter attend?|string|1|hogwarts
General|Which company, during the 1984 Super Bowl, aired what is considered one of the best commercials in TV history?|string|2|apple
Entertainment|Who In The World Of Music Has The Real Name Of Derek Dick?|string|3|fish
Entertainment|"Radio Gaga" Was A 1984 Hit For What Band?|string|3|queen
General|The world's smallest mammal is this type of ___ bat of Thailand, weighing less than a penny?|string|2|bumblebee
General|The treatment of disease by chemical substances which are toxic to the causative micro-organisms is called ____________?|string|5|chemotherapy
General|What animal is responsible for most deaths in the USA annually?|string|2|dogs
Geography|Where would you be if you landed smack in the middle of Plock?|string|5|poland
General|What is the fear of heredity known as?|string|1|patroiophobia
General|License Plates: What job does SRREAL have?|string|3|artist
Science & Nature|A Phon is a unit of what?|string|3|loudness
General|Who was the law for a shire?|string|2|reeve
General|What lies east of Mauritius?|string|3|australia
General|Cushat, Rock and Stock are all types of this bird?|string|2|doves
Geography|What is the capital of Liberia?|string|5|monrovia
History & Holidays|In which war was the charge of the Light Brigade?|string|5|crimean
Entertainment|"Dancing With Tears In My Eyes" Was A 1984 Hit For Which Group?|string|5|ultravox
Sports & Leisure|Which Country Hosted The Olympic Games In 2004?|string|5|greece
General|In a nod to the bird depicted on its face, the dollar coin of Canada is affectionately known as what?|string|2|loonie
Entertainment|In a nod to the venue where they were traditionally worn,women's gloves that extend to the elbow are called what?|string|3|opera
History & Holidays|In a non-leap year, April Fools' Day would fall on what numerical day of the year?|string|3|91
Food & Drink|In a pinch, which kind of soda can be used to put out a kitchen fire?|string|2|baking
Entertainment|In a popular version of the children's tune "The Wheels on the Bus,” the "driver on the bus says move on ________"?|string|1|back
Entertainment|In a popular '80s cartoon,what creatures often sing a catchy tune with the simple lyrics "La la la la la la,la la la la la"?|string|1|smurfs
Entertainment|In a popular '80s TV theme,"You take the good,you take the bad,you take them both,and there you have facts of _______"?|string|2|life
Entertainment|In a public statement,Justin Timberlake famously blamed the 2004 Super Bowl halftime debacle a wardrobe _________?|string|2|malfunction
Food & Drink|In a recent fast food survey by Zagat,Five Guys defeated In-N-Out having the best _________?|string|2|burger
Entertainment|In a running joke,Bugs Bunny frequently finds himself in strange locations after taking a wrong turn in what city?|string|5|albuquerque
Entertainment|In a song title on Michael Jackson's 1982 "Thriller" album, what does the P in "P.Y.T." stand for?|string|4|pretty
General|In a standard Sudoku game, how many individual digits are there once the entire grid has been filled?|string|5|81
General|In a T-bone steak, the meat is attached to what "T"-shaped bone?|string|4|vertebra
Question.cpp
#ifndef QUESTION_CPP
#define QUESTION_CPP
#include < iostream >
#include < string >
using namespace std;
// Global constants for number of types
const int NUM_TYPES = 6;
const string KNOWN_TYPES[NUM_TYPES] = { "int", "double", "bool", "char", "string"};
template < class T >
struct Question {
public:
// Name: Overloaded Constructor
// Desc: Constructs a question object given all fields.
// Precondition: Question must be templated by the data type passed in as an argument.
// Postcondition: A new Question object is created for use.
Question(string subject, string question, string datatype, int difficulty, T answer);
// Name: Copy Constructor
// Desc: Makes a copy of an existing Question object
// Precondition: A Question object exists.
// Postcondtion: A new populated Question exists
Question(const Question&);
// Name: Destructor
// Desc: Resets variables and deallocates dynamically allocated memory
// Precondition: A Question object exists.
// Postcondtion: All dynamically allocated memory is destroyed.
~Question();
// Name: CheckAnswer
// Desc: Compares passed value with m_answer
// Precondition: A Question object exists.
// Postcondtion: Returns true if value passed matches m_answer else false.
bool CheckAnswer(T submission);
// Name: Overloaded insertion operator
// Desc: Returns ostream object for the question prompt. Presents
// question and answer data type.
// Precondition: Question object exists
// Postcondition: Returns ostream of question prompt.
template< class Y > //As friend function, has to use different templated variable
friend ostream& operator<< (ostream& output, Question< Y >&);
//Member variables (all public)
string m_subject; //Subject for question
string m_question; // Question
string m_datatype; // What type of data used for answer
int m_difficulty; // Difficulty Rating (1 - 5)
T m_answer; // Answer to question
bool m_isAnswered; // True once question is answered. Otherwise, false.
};
//**********Implement Question Class Here***********
#endif
Trivia.cpp
#ifndef TRIVIA_CPP
#define TRIVIA_CPP
#include "Lqueue.cpp"
#include "Question.cpp"
#include < fstream >
#include < vector >
using namespace std;
const string DEFAULT_FILE = "proj5_string.txt";
const char DELIMITER = '|';
template < class T >
class Trivia {
public:
// Name: Default Constructor
// Desc: Displays the title, Loads Questions and calls menu
// Indicates if the file was not loaded.
// Precondition: None
// Postcondition: User is prompted with assignment menus
Trivia(string filename= DEFAULT_FILE);
// Name: Destructor
// Desc: Deallocates memory allocated for the Questions and
// resets all variables.
// Precondition: A Trivia exists.
// Postcondition: All dynamically allocated memory in Trivia is deleted.
~Trivia();
// Name: LoadQuestions
// Desc: Each input file will be for a specific type of question (int, double, string)
// Reads in Questions from a file and stores them in anLqueue.
// An input file will be for exactly one type of question (int, double, string)
// Precondition: None.
// Postcondition: Returns true if file was read. Otherwise, it returns false.
bool LoadQuestions(string filename);
// Name: MainMenu
// Desc: Presents user with menu options for showing subjects and allowing
// user to work on a subject.
// Precondition: None.
// Postcondition: The main menu is presented.
void MainMenu();
// Name: DisplaySubjects
// Desc: Presents all Subjects with corresponding numerical identifiers.
// Precondition: Subjects have been added.
// Postcondition: All assignments are printed to the screen.
void DisplaySubjects();
// Name: StartSubject
// Desc: Starts working on a selected Subject.
// Displays the number of questions in subject.
// Starts at beginning and goes through each question.
// After all questions have been answered:
// displays total correct, incorrect, and percentage correct
// Precondition: m_questions has been populated
// Postcondition: Returns to main menu
void StartSubject();
// Name: AddSubject
// Desc: Checks to see if a subject exists in m_subjects.
// If not, inserts subject into m_subjects.
// Precondition: A Subject exists.
// Postcondition: Add subject to m_subjects if new subject.
void AddSubject(string subject);
// Name: ChooseSubject
// Desc: Allows a user to choose one of the subjects to work on. Lists all subjects
// in m_subjects and allows use to choose one. Returns value - 1 (location in vector)
// Precondition: A Subject exists.
// Postcondition: Returns value entered minus one
int ChooseSubject();
// Name: QuestionsPerSubject
// Desc: Iterates over m_questions and counts how many questions match the subject
// passed into function
// Precondition: A Subject exists.
// Postcondition: Returns number of questions of a particular subject
int QuestionsPerSubject(string subject);
// Name: DisplayTitle
// Desc: Displays opening Welcome message
// Precondition: None.
// Postcondition: Title is displayed.
void DisplayTitle();
private:
Lqueue< Question< T >* >* m_questions; // Holds questions using a specific data type
vector< string > m_subjects; //Populated as file is loaded
};
//**********Implement Trivia Class Here***********
#endif