Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
4007CEM-Timetabling-Project/main.cpp
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
57 lines (50 sloc)
1.99 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// timetabling system.cpp : This file contains the 'main' function. Program execution begins and ends there. | |
// | |
#include <iostream> | |
#include <sqlite3.h> | |
#include "database_init.h" | |
#include "data_input.h" | |
#include "data_retrieve.h" | |
using namespace std; | |
int main() | |
{ | |
const char filler = '-'; //for output presentation | |
const int filler_length = 10; //for output presentation | |
char response; //user input container for simple choice selection | |
bool loop = true; | |
database_init(); //creates database if does not already exist | |
cout << "[Timetable Database Manipulation Software]" << endl; | |
while (loop) { | |
cout << "Would you like to enter or retrieve data?" << endl; | |
cout << "E " << string(filler_length, filler) << " Enter" << endl; | |
cout << "R " << string(filler_length, filler) << " Retrieve" << endl; | |
cout << "X " << string(filler_length, filler) << " Exit program" << endl; | |
cin >> response; | |
if (toupper(response) == 'X') | |
{ | |
exit(EXIT_SUCCESS); | |
} | |
else if (toupper(response) == 'E') | |
{ | |
data_input(); | |
} | |
else if (toupper(response) == 'R') | |
{ | |
data_retrieve(); | |
} | |
else | |
{ | |
cout << "Please input one of the specified characters to access the corresponding option." << endl; | |
} | |
} | |
return (0); | |
} | |
// Run program: Ctrl + F5 or Debug > Start Without Debugging menu | |
// Debug program: F5 or Debug > Start Debugging menu | |
// Tips for Getting Started: | |
// 1. Use the Solution Explorer window to add/manage files | |
// 2. Use the Team Explorer window to connect to source control | |
// 3. Use the Output window to see build output and other messages | |
// 4. Use the Error List window to view errors | |
// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project | |
// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file |