so basically im lost i tryed following the teachers notes and i cant get it to work the dating.cpp is mine the other three files are what the teacher gave us to use if anyone could help i would be greatful
this is dating.cpp
/*Input: The program will read the input from stard input. The program will crea!
the other of females, then match the individuals according to their interests.
Output: All written output goes to standard output. The program prompts a lis!
the corresponding commands output.
Preconditions: The list must have all of the required fields. All input must !
Postconditions:
*/
#include <iostream>
using namespace std;
#include <fstream>
#include <string>
#include "ListA.cpp"
const int MALE = 0 ;
const int FEMALE = 1 ;
int genderID = 0;
ifstream clientLists ("clients.txt") ;
int matchLoc = 0 ;
/*
Function name: NEWCLIENT
Input: the new clients information
Preconditions: Trys to find a female match when entered
Postconditions: Must print out new client and match or no match
CallersoCommands
Callees:
/*
Function name: UNMATCH
Input: The last and first name of client
Output: The two matches "current match" fields are set to zero
Preconditions: Must have <last name> <first name>
Postconitions: Changes both matches
Callers: doCommands
Callees:
*/
clientRecType item ;
void getMainData ( clientRecType & item , char & gender , ifstream inFile)
{
void putClientInList(clientRecType & item , char gender , ListItemType & clientLists) {
int which = 0 ;
int pos ;
char M ;
char F ;
if (gender == M) which = MALE ;
else which = FEMALE ;
clientLists[which] insert(pos,item, success) ;
pos = clientLists[which].getLength() + 1 ;
clientRecType client ;
clientRecType candidate ;
}
void isMatch (clientRecType client, clientRecType candidate){
bool result ;
if (candidate.matchLoc != 0) result=false ;
else{
int numMatchs = 0 ;
int j ;
for (j = 0;j<=numIntrs - 1;j++){
if (client.interest= candidate.interest)numMatchs++ ;
}
if (numMatchs>=3) result=true;
}
}
void makeMatch( ListItemType clientLists, int genderID, int matchLoc, int oppLoc){
int client ;
int oppClient ;
int oppID =( 1 - genderID) ;
}
void doMatch( ListItemType clientLists , int genderID , int pos , int numOpp) {
int oppSex = (1 - genderID) ;
numOpp = clientLists[oppSex].getLength() ;
int posFound = 0 ;
for ( pos=1; pos<=clientLists[oppSex].getLength();pos++){
}
if (posFound !=0) makeMatch();
else if(posFound=0) cout << "no match" ;
}
void unMatch()
{
cout <<"last and first name are entered, if paired their match number ";
}
/*
Function name: PRINTMATCH
Input: list of paired clients
Output: prints out paired clients
Preconditions: prints only paired clients
Postconditions: non
Callers: doCommands
Callees:
*/
void printMatch()
{
cout <<"reads lists and finds clients with client match > 0 and prints";
}
/*
Function name: PRINTFREE
Input: list of clients
Output: prints list of clients who aren't matched
Preconditions: prints full name and phone numbers
Postconditions: non
Callers: doCommands
Callee:
*/
void printFree(ListItemType clientList)
{
int pos ;
int oppSex = genderID - 1;
for ( pos=1; pos<=clientLists[oppSex].getLength();pos++){
cout << clientList[oppSex];
}
}
/*
Function name: QUIT
Input: quit
output: prints out quit and then "Have a good day."
Preconditions: none
Postconditions: none
Callers: doCommands
Callees: none
*/
void quit()
{
cout <<"received QUIT command, exiting. Have a good day. then ends program" ;
}
/* function name: DOCOMMANDS
Input: select command from menu
Output: prints out the command selected and the output of that command
Preconditions: must select specific command or else it reasks
Postconditions: none
Callers: main
Callees: commands
this is LISTA.cpp
// *********************************************************
// Implementation file ListA.cpp for the ADT list
// Array-based implementation
// *********************************************************
#include "ListA.h" //header file
List::List() : size(0)
{
} // end default constructor
int List::getLength() const
{
return size;
} // end getLength
void List::insert(int index, ListItemType newItem,
bool& success)
{
success = (index >= 1) &&
(index <= size + 1) &&
(size < MAX_LIST);
if (success)
{ // make room for new item by shifting all items at
// positions >= index toward the end of the
// list (no shift if index == size+1)
for (int pos = size; pos >= index; --pos)
items[translate(pos+1)] = items[translate(pos)];
// insert new item
items[translate(index)] = newItem;
++size; // increase the size of the list by one
} // end if
} // end insert
void List::remove(int index, bool& success)
{
success = (index >= 1) && (index <= size) ;
if (success)
{ // delete item by shifting all items at positions >
// index toward the beginning of the list
// (no shift if index == size)
for (int fromPosition = index+1;
fromPosition <= size; ++fromPosition)
items[translate(fromPosition-1)] = items[translate(fromPosition)];
--size; // decrease the size of the list by one
} // end if
int List::translate(int index) const
{
return index-1;
} // end translate
// End of implementation file.
THIS IS LIST.h
// *********************************************************
// Header file ListA.h for the ADT list
// Array-based implementation
// *********************************************************
#include "clientRec.h"
const int MAX_LIST = 100 ;
typedef clientRecType ListItemType;
class List
{
public:
List(); // default constructor
// destructor is supplied by compiler
// list operations:
bool isEmpty() const;
// Determines whether a list is empty.
// Precondition: None.
// Postcondition: Returns true if the list is empty;
// otherwise returns false.
int getLength() const;
// Determines the length of a list.
// Precondition: None.
// Postcondition: Returns the number of items
// that are currently in the list.
void insert(int index, ListItemType newItem,
bool& success);
// Inserts an item into the list at position index.
// Precondition: index indicates the position at which
// the item should be inserted in the list.
// Postcondition: If insertion is successful, newItem is
// at position index in the list, and other items are
// renumbered accordingly, and success is true;
// otherwise success is false.
// Note: Insertion will not be successful if
// index < 1 or index > getLength()+1.
void remove(int index, bool& success);
// Deletes an item from the list at a given position.
// Precondition: index indicates where the deletion
// should occur.
// Postcondition: If 1 <= index <= getLength(),
// the item at position index in the list is
// deleted, other items are renumbered accordingly,
// and success is true; otherwise success is false.
void retrieve(int index, ListItemType& dataItem,
bool& success) const;
// Retrieves a list item by position.
// Precondition: index is the number of the item to
// be retrieved.
// Postcondition: If 1 <= index <= getLength(),
// dataItem is the value of the desired item and
// success is true; otherwise success is false.
private:
ListItemType items[MAX_LIST]; // array of list items
int size; // number of items in list
int translate(int index) const;
// Converts the position of an item in a list to the
// correct index within its array representation.
}; // end List class
// End of header file.
THIS IS CLIENTREC.h
#include <iostream>
#include <string>
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.