Advertisement
Advertisement
| 05.08.2008 at 02:40AM PDT, ID: 23385463 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
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: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: |
//Ennio Bozzetti
//Hash.h
#ifndef HASH_H
#define HASH_H
#include <iostream>
#include <string>
#include <stdlib.h>
#include "student.h"
class hash{
public:
hash();
hash(int newsize);
~hash();
void insert(student * newstudent);
void display();
private:
int size;
student * myArray;
int * used;
};
#endif
//ENnio Bozzetti
//hash.cpp
#include "hash.h"
#include <stdlib.h>
hash::hash(){
}
hash::hash(int newsize){
size = newsize;
myArray = new student[size];
used = new int[size];
}
hash::~hash(){
delete [] myArray;
delete [] used;
}
void hash::insert(student * newstudent){
int key = atoi(newstudent->getStudentLName().c_str()) % size;
int counter=0;
int done = 0;
while(counter < size && !done){
if(used[key] == 0){
myArray[key] = *newstudent;
used[key] = 1;
done = 1;
} else {
key = (key + 1) % size;
counter++;
}
}
}
void hash::display(){
for(int i = 0; i < size; i++){
if(used[i] == 1){
cout << myArray[i].getStudentID() << " " << myArray[i].getStudentFName();
cout << " " << myArray[i].getStudentLName() << " " << myArray[i].getStudentMName();
cout << endl << myArray[i].getStudentHometown() << " " << myArray[i].getStudentState() << endl;
cout << myArray[i].getStudentPhone() << endl;
cout << myArray[i].getStudentGender() << " " << myArray[i].getStudentYear() << " " << myArray[i].getStudentCredits() << " " << myArray[i].getStudentGpa() << endl;
cout << myArray[i].getStudentMajor() << endl;
}
}
}
//Ennio Bozzetti
//hashdriver.cpp
#include <iostream>
#include <fstream>
#include "hash.h"
#include "student.h"
using namespace std;
int main(){
hash studentHash(100);
int counter =0;
string filename;
cout << "Please enter the studet file: ";
cin >> filename;
//Populate the linked list from file
string sID, sFname, sLname, sMname, sHometown, sState, sPhone, sGender, sMajor;
int year, credit;
double gpa;
ifstream fin;
fin.open(filename.data());
while (!fin.eof()){
if (counter == 1){
fin >> sID;
}
//Get the student first name
if (counter == 2){
fin >> sFname;
}
//Get the student last name
if (counter == 3){
fin >> sLname;
}
//Get the student middle name
if (counter == 4){
fin >> sMname;
}
//Get the student hometown name
if (counter == 5){
fin >> sHometown;
}
//Get the student state name
if (counter == 6){
fin >> sState;
}
//Get the student phone
if (counter == 7){
fin >> sPhone;
}
//Get the student gender
if (counter == 8){
fin >> sGender;
}
//Get the student year
if (counter == 9){
fin >> year;
}
//Get the student credit
if (counter == 10){
fin >> credit;
}
//Get the student gpa
if (counter == 11){
fin >> gpa;
}
//Get the student major
if (counter == 12){
fin >> sMajor;
student s(sID, sFname, sLname, sMname, sHometown, sState, sPhone, sGender, year, credit, gpa, sMajor);
student * studentPointer;
*studentPointer = s;
studentHash.insert(studentPointer);
counter = 0;
}
counter++;
}
return 0;
}
|
| Microsoft |
| Apple |
| Internet |
| Gamers |
| Digital Living |
| Virus & Spyware |
| Hardware |
| Software |
| ITPro |
| Developer |
| Storage |
| OS |
| Database |
| Security |
| Programming |
| Web Development |
| Networking |
| Other |
| Community Support |
| 05.08.2008 at 02:45AM PDT, ID: 21523388 |