CIS275LabProject3 - CIS 275, Fall 2007 Laboratory Project 3...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CIS 275, Fall 2007 Laboratory Project 3 Source Code in C++ //dataProjection.cpp #include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; void project(vector < int >Emp_ID,vector <string>Emp_first,vector <string>Emp_last,vector < int >Emp_rate); void select(vector < int >Emp_ID,vector <string>Emp_first,vector <string>Emp_last, vector < int >Emp_rate); int main () { vector < int > Emp_ID; vector <string> Emp_first; vector <string> Emp_last; vector < int > Emp_rate; int category,number; cout << "The Landscaping Employee database has 4 fields: Employee ID, Employee First Name, Employee Last Name, and Employee Rate per Hour:\n"<<endl; cout << "Enter the number of Employees to be in the database: "; cin >> number; int ID; string string; int rate; for ( int i=0;i<number;i++) { cout << "Enter the Employee ID: "; cin >> ID; Emp_ID.push_back(ID); cout << endl; cout << "Enter the Employee's First Name that works for Landscaping: "; cin >> string; Emp_first.push_back(string); cout << endl; cout << "Enter the Employee's Last Name: "; cin >> string; Emp_last.push_back(string); cout << endl; cout << "Enter the Employee's Rate: "; cin >> rate; Emp_rate.push_back(rate); cout << endl; } cout << "Choose a selection or a projection category:\n\t 1 = Selection\n\t 2 = Projection\n\t "; cout << "Type your choice number here: "; cin >> category; if (category == 1) select(Emp_ID,Emp_first,Emp_last,Emp_rate); else if (category == 2) project(Emp_ID,Emp_first,Emp_last,Emp_rate); return 0; } void select(vector < int >Emp_ID,vector <string>Emp_first,vector <string>Emp_last, vector < int >Emp_rate) { int column; int key; vector< int >::iterator value1; vector<string>::iterator value2; vector<string>::iterator value3; vector < int >::iterator value4; cout << "Select the column number\n\tType 1 for Employee ID\n\tType 2 for Employee's First Name\n\tType 3 for Employee's Last Name\n\tType 4 for Employee Rate: ";...
View Full Document

Page1 / 7

CIS275LabProject3 - CIS 275, Fall 2007 Laboratory Project 3...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online