6. const char CHANGE_ASKING_PRICE = 'C';
const char EXIT_PROGRAM = 'E';
//***************************************************
**********************
// FUNCTION: main
// DESCRIPTION: Main function will call various functions to
read, input,
// calculate and display per account the
phone usage totals
// CALLS TO:
// IntroProgram
//***************************************************
**********************
int main() {
// variables
int count;
7. char additional;
propertiesRec listings;
bool exit=false;
n = new node();
// Begin Program execution
IntroProgram ();
additional = MenuOne();
if (additional == Y_UPPERCASE) {
Existing_Listings();
}
else {
10. {
n->WriteToFile();
exit = true;
}
}
}
return 0;
}
//***************************************************
**********************
// FUNCTION: Program Introduction
// DESCRIPTION: Introduce user to Reality Listing Program
// INPUT: None
// OUTPUT: Display a introduction to the user of the
program.
//***************************************************
**********************
void IntroProgram (void)
11. {
cout << endl;
cout << "Welcome to the Realtor's Association MLS
Listing(s) Program" << endl;
cout << endl;
}
//***************************************************
**********************
// FUNCTION: Menu One
// DESCRIPTION: First menu that the user can use to make a
choice.
// INPUT: User input and error correction
// OUTPUT: Returns an answer to the main function.
//***************************************************
**********************
char MenuOne()
{
char answer;
cout << endl;
12. cout << "Load existing data from file (Y/N) " << endl;;
cout << "Y - Existing MLS Listing(s)" << endl;
cout << "N - Enter New Listing(s)" << endl;
cout << "Enter choice: ";
do {
cin >> answer;
answer = toupper(answer);
if (answer != Y_UPPERCASE && answer !=
N_UPPERCASE) {
cout << "invalid choice: re-entern";
}
} while (answer != Y_UPPERCASE && answer !=
N_UPPERCASE);
return answer;
}
13. //***************************************************
**********************
// FUNCTION: Existing Records
// DESCRIPTION: Reads the LISTINGS.txt file into an linked
list
// INPUT: inputFile (LISTINGS.txt) are called for read
from this
// function, if there is no txt and error will
be screened
// and the user can either exit or add new
data to the new
// linked list.
// OUTPUT: A return value countRec records and adds up
the number of
// records read into the array-struct.
//***************************************************
**********************
int Existing_Listings()
{
int availabilityInt;
char userAns;
14. char filename[20];
cout << "Enter a filename: ";
cin >> filename;
struct propertiesRec listings;
ifstream inputFile(filename);
if (!inputFile)
{
cout<< "INPUT FILE DOES NOT EXISTS." << endl;
}
else
{
while ( !inputFile )
{
15. cout << "No Existing file data available or Input
file did not open." << endl;
cout << "Would you like to (A)dd new listings
or (E)xit?" << endl;
cin >> userAns;
userAns = toupper (userAns);
if ( userAns == 'A' )
{
Add_New_Listing();
return 0;
}
if ( userAns == 'E' )
{
return 1;
}
}
while ( inputFile >> listings.mlsNum )
17. **********************
// FUNCTION: (A)dd Records
// DESCRIPTION: This function takes user input via keyboard
and copies it
// per member into a array-struct record.
// INPUT: Take use input and also countRec (# of actual
records at
// that moment. It also calls verification
functions to verify
// the data being entered.
// OUTPUT: Adds a new record the array-struct and asks if
they would
// like to continue or stop.
//***************************************************
**********************
void Add_New_Listing ()
{
char more;
do
{
propertiesRec listings;
18. listings.mlsNum = Get_Validate_MLS_Input();
listings.price = Get_Validate_Price_Input();
listings.status = Get_Status_Entry();
listings.zipCode = Get_Validate_ZipCode_Input ();
listings.realtor = Get_Validate_Realtor_Input ();
n->Append_List( listings ); // Appends
the linked list
cout << endl;
cout << "More Listing(s) to add (Y)es or (N)o?";
cin >> more;
} while ( toupper(more) != N_UPPERCASE );
}
22. // FUNCTION: User Menu Choices
// DESCRIPTION: This is the central user menu where they
can make choices.
// INPUT: This function takes no input, but does error
check what the
// user enters.
// OUTPUT: A menu with all the major takes that this
program can accomplish.
//***************************************************
**********************
char UserMenuChoices ()
{
char answer;
cout << endl;
cout << "User Menu Choices:" << endl;
cout << "------------------" << endl;
cout << "D - Display All" << endl;
cout << "A - Add Listing(s)" << endl;
25. {
header= new node ( Xdata );
}
else
{
q = new node();
q = header;
while( q->Get_Next() !=0 )
{
q = q->Get_Next();
}
t = new node( Xdata );
q->put_next( t );
}
}
//***************************************************
**********************
// FUNCTION: Remove_Node
26. // DESCRIPTION: XXXXXXXXXXXXXXXXXXXXXXX
// INPUT: XXXXXXXXXXXXXXXXXXXXXXXXXX
// OUTPUT: XXXXXXXXXXXXXXXXXXXXXXXX
//***************************************************
**********************
void node::Remove_Node()
{
Display_MLS_Numbers();
int mls;
cout << "Enter MLS to remove: ";
mls = Get_Validate_MLS_Input();
node *q,*r;
q = header;
// If node to be deleted is the first node
if( q->Get_MLS() == mls )
{
27. header = q->Get_Next();
delete q;
return;
}
//if node to be deleted is not the first node
r = q;
while( q!= 0 )
{
if( q->Get_MLS() == mls )
{
r->next=q->next;
delete q;
return;
}
r = q;
28. q = q->Get_Next();
}
cout << "MLS number " << mls << " not Found.";
}
//***************************************************
**********************
// FUNCTION: WriteToFile
// DESCRIPTION: XXXXXXXXXXXXXXXXXXXXXXX
// INPUT: XXXXXXXXXXXXXXXXXXXXXXXXXX
// OUTPUT: XXXXXXXXXXXXXXXXXXXXXXXX
//***************************************************
**********************
void node::WriteToFile()
{
if ( header == NULL ) // End of list or not populated head
node
{
29. cout << "No existing data - no data will be saved" <<
endl;
}
char ch;
bool again= true;
cout<<"Do you want to save the listing(y/n): ";
cin>>ch;
ch=toupper( ch );
if ( ch=='Y' )
{
char filename[20];
cout<<"Enter file name to save: ";
cin>>filename;
do
{
36. }
inputFile.close();
if ( found == false )
{
cout << "No matching MLS number found" << endl;
}
}
//***************************************************
**********************
// FUNCTION: Enter MLS listing
// DESCRIPTION: Gets and validates the MLS number from
the user
// INPUT: User input with error correction.
// OUTPUT: Writes data back to add data function.
//***************************************************
**********************
int Get_Validate_MLS_Input ()
37. {
int MAX_MLS_NUMBER = 6;
int MIN = 100000;
int MAX = 999999;
int mlsNum;
cout << endl;
cout << "Enter MLS number (Between 100000 - 999999)";
cin >> mlsNum;
int numIntegers = CountIntegers( mlsNum );
while (cin.fail())
{
cin.clear();
cin.ignore();
cout << "not integer" << endl;
cin.clear();
cin.ignore();
38. cin>>mlsNum;
}
numIntegers = CountIntegers( mlsNum );
do {
if ( numIntegers > MAX_MLS_NUMBER )
{
cout << endl;
cout << "Length of MLS too long - Only 6 Digits."
<< endl;
cin >> mlsNum;
numIntegers = CountIntegers( mlsNum );
}
} while ( numIntegers > MAX_MLS_NUMBER ) ;
while (! ( mlsNum > MIN ) || ( mlsNum > MAX ))
39. {
cout << "Invalid Entry - (Between 100000 -
999999)";
cin.clear();
cin.ignore();
cin>>mlsNum;
}
return mlsNum;
}
//***************************************************
**********************
// FUNCTION: Enter Price
// DESCRIPTION: Gets and validates the price entered by the
user.
// INPUT: User input with error correction.
// OUTPUT: Writes data back to add data function.
//***************************************************
**********************
double Get_Validate_Price_Input ()
40. {
int MAX_Price_Length = 6;
int MIN = 1;
int MAX = 999999;
int price;
cout << endl;
cout << "Enter Price (Between 1 - 999999)";
cin >> price;
int numIntegers = CountIntegers( price );
while ( cin.fail() )
{
cin.clear();
cin.ignore();
cout << "not integer" << endl;
41. cin>>price;
}
numIntegers = CountIntegers( price );
do {
if ( numIntegers > MAX_Price_Length )
{
cout << endl;
cout << "Length of Price too long - Only 6
Digits." << endl;
cin >> price;
numIntegers = CountIntegers( price );
}
} while (( numIntegers > MAX_Price_Length ) && (
cin.fail()) );
42. return price;
}
//***************************************************
**********************
// FUNCTION: Count Number of Integers
// DESCRIPTION: counts the numbers
// INPUT: Enter price function inputs the user data.
// OUTPUT: Returns the actual numbers entered by the user
to the calling
// function.
//***************************************************
**********************
int CountIntegers( int number )
{
if ( number < 10 ) {
return 1;
}
43. int countInt = 0;
while ( number > 0 )
{
number /= 10;
countInt++;
}
return countInt;
}
//***************************************************
**********************
// FUNCTION: Enter ZipCode
// DESCRIPTION: Gets and validates the zipCode number.
// INPUT: User input with error correction.
// OUTPUT: Writes data back to add data function.
//***************************************************
**********************
45. {
cout << "Invalid ZipCode - '-' is not at correct
position" << endl;
valid = false;
}
else
{
for ( int counter = 0; counter <= 4; counter++ )
{
if ( !isdigit(zipCode[counter]) )
{
cout << "Invalid ZipCode - all must
be digits" << endl;
valid = false;
}
}
for ( int counter = 6; counter <= 9; counter++ )
{
if ( !isdigit(zipCode[counter]) )
46. {
cout << "Invalid ZipCode - all must
be digits" << endl;
valid = false;
}
}
}
}while ( valid == false );
return zipCode;
}
//***************************************************
**********************
// FUNCTION: Enter Realty Company Name
// DESCRIPTION: Gets and validates the propertiesRec name
// INPUT: User input with error correction.
// OUTPUT: Writes data back to add data function.
//***************************************************
47. **********************
string Get_Validate_Realtor_Input ()
{
string propertiesRec;
int counter;
bool valid = true;
do
{
cout << endl;
cout << "Enter propertiesRec Name, only letter(s) and
spaces allowed " << endl;
cin.ignore();
getline( cin, propertiesRec );
if ( propertiesRec.length() >
MAX_REALTY_NAME )
{
cout << "Invalid propertiesRec Name"
48. << endl;
getline( cin, propertiesRec );
}
} while ( propertiesRec.length() > MAX_REALTY_NAME
);
// This tests for letters
for ( int counter = 0; counter < propertiesRec.length();
counter++ )
{
if ( !isalpha(propertiesRec[counter]) && valid ==
true )
{
cout << "Invalid propertiesRec Name"
<< endl;
getline( cin, propertiesRec );
}
// This is the first letter Capitializer
50. //***************************************************
**********************
// FUNCTION: Get Status Entry
// DESCRIPTION: Takes user input and enters the status via
switch.
// INPUT: User input with error correction.
// OUTPUT: Outputs the data into the array-struct via add
data function.
//***************************************************
**********************
availability Get_Status_Entry()
{
int entry;
cout << "Enter the listing's status ( 0 - Available; 1 -
Contract, 2 - Sold): ";
while ( !(cin >> entry) || entry < 0 || entry > 2 )
{
cout << "Invalid listing status, please enter 0 -
Available, 1 - Contract, or 2 - Sold." << endl;
cout << "Try again: ";
51. cout << endl;
}
switch (entry)
{
case 0:
return AVAILABLE;
case 1:
return CONTRACT;
case 2:
return SOLD;
default:
break;
}
}
//***************************************************
**********************
// FUNCTION: Status Enum to Text
52. // DESCRIPTION: Converts from cell integer to enumuration
for display
// INPUT: Is call by the display all function.
// OUTPUT: Returns the correct converted enumeration
status type.
//***************************************************
**********************
string Status_Enum_Text (int status)
{
switch (status){
case 0:
return "AVAILABLE";
case 1:
return "CONTRACT";
case 2:
return "SOLD";
default:
break;
53. }
}
//***************************************************
******************
// FUNCTION: Display MLS Numbers
// DESCRIPTION: Displays MLS list from the Linked-list.
Checks first if
// there are any MLS records.
// INPUT: Reads the Linked-list
// OUTPUT: Outputs to screen a header and list of
current MLS#.
//***************************************************
*******************
void Display_MLS_Numbers ()
{
node *q;
if ( header == NULL )
{
55. // DESCRIPTION: Performs a check on the existence of the
user inputed
// file name.
// INPUT:
// OUTPUT:
//
//***************************************************
*******************
bool Does_File_Exist ( const char *fileName )
{
ifstream inputFile( fileName );
bool exists = false;
if ( inputFile )
exists= true;
return exists;
56. }
APA Assignment Instructions
Attached you will find the following sections of a formal paper
written using APA format:
· Title Page
· Abstract
· First two pages of Chapter 1
· Reference List
Unfortunately, this paper contains multiple common formatting
errors. To complete this assignment you must correct the errors
in each of the above sections and return the assignment for
evaluation. Errors include omissions as well as commissions.
For example, when looking at the title page you want to observe
for omission errors by checking to see that all necessary
components have been included and commission errors by
determining whether or not the information that has been
provided is in the right place on the page. If you do not have a
copy of the 6th Edition of the APA Manual, you can use one of
the APA Web sites listed in Module 5.
Please note: This assignment only contains selected sections of
a formal paper. Other required sections (for example, a table of
contents) have been omitted. For the purpose of this assignment,
you only need to address the sections provided. You also do not
have to correct any grammar errors you may find.
Title Page
Writing for Publication
57. Abstract
Writing for publication is more than opportunity for
professional development. It is a responsibility of all health
care professionals. Unfortunately, many health care
professionals, especially those outside of academia are
unfamiliar with the publication process. The purpose of this
paper is to provide a detailed description of the publication
process from conception of the idea through actual publication.
The topics addressed include finding a publishable idea, finding
the right journal for publication, contacting the editor and
preparing and submitting a manuscript. The paper will also
discuss actual and perceived obstacles to publication.
Chapter 1
Introduction
In this world of evidence based practice, it is becoming more
and more important for health care professionals to share their
clinical successes and their failures. Health care professionals
have a responsibility to themselves, their colleagues and their
patients to read what others are saying, to evaluate the
relevance of what they are reading and to write so that their
successes can be implemented by others. The opportunities to be
published are growing every year. “In the past two decades
there has been a phenomenal rise in the number of peer
reviewed publications, either as paper-print or as online
journals, and this has been in response to the growing demand
for information, research activity and the necessity to apply
empirical findings to the delivery of patient care (Albarran, J. &
Scholes, J. 2005, page 72)”.
For the novice writer, writing for publication can appear to be a
daunting task and many fear that they haven’t the time, skill or
experience to undertake the challenge (Albarren, J., & Scholes,
J. 2005; Doyle,E., et. al., 2004). However, writing for
publication is not the “Mount Everest” most fear and the
process is one that can be learned. Although writing requires a
commitment, it is a doable task that can be enjoyable and
58. rewarding.
GETTING STARTED
Making the decision to try your hand at publication is the first
hurdle. Once the decision has been made, an idea needs to be
formulated and a work plan established. When choosing a topic,
experts agree that you should begin by writing about a topic that
you know well (Cook, R. 2000). “Ideas for a journal article are
everywhere. Start with your area of practice. Think about the
type of work you do, the types of clients you work with and the
things you do well. For example, if your colleagues always ask
for your advice on how to handle a particular situation, maybe
you want to write about it. If your unit is known for the work it
does with a particular type of patient, you may have publishable
information to share (US Department of the Health Professions,
pages 22-23). First time writers sometimes choose to write with
another person. Even if you want to write alone, it may help to
brainstorm with a colleague to come up with some ideas to
consider.
Albarran and Scholes (2006) suggest that before you go too far
down the path, you think about the type of journal, magazine or
newsletter you want to publish in. The information you will
provide and your writing style will vary depending upon the
audience. In addition, you will want to review recent issues of
the publications to see what topics have been covered over the
past year. You may not be able to get an article published if a
similar topic was recently covered. In addition, by looking
through publications you may find a call for articles on a
particular topic for a special focused edition of the publication.
Once you think you have found the right publication, it is
important that you check with the editor (Griffin-Sobel, J.
1999). By providing a brief description an editor can tell you if
there is interest in the topic and may be able to provide further
direction that will result in an acceptance of your manuscript.
Writing takes time and commitment and it is easy to put the
manuscript away and never pick it up again. Therefore, once
you have made a commitment to write an article, prepare a work
59. plan and timeline for yourself. This simple strategy will greatly
improve the likelihood of your success. In addition to
establishing deadlines, you should think about and plan for
when and where you will write and where you will find the
resources you will need to write the article. For example, you
may need to include a reference list or pictures. Pick a place
and time where you can write undisturbed. Make sure your
timelines is consistent with any deadlines you may receive from
the editor…a manuscript that is late, may not get published.
References
Albarran, John W., & Scholes, Julie (2005). How to Get
Published: Seven Easy Steps. British Association of Critical
Care, Nursing in Critical Care, 10(2), 72-77.
Cook, Ralph. (2000). The Writers Manual, Oxford: Radcliff
Medical Press
Doyle, Eva J, Coggins, Claudia, & Lanning, Beth (2004).
Writing for Publication in Health Education. American Journal
of Health Studies, 19(2), 100-109.
Duncan, Sarah Smith. Writing for Publication. (Retrieved from
the World Wide Web 10/27/06 at
http://www.library.jhu.edu/researchhelp/general/publishing.html
)
Griffin-Sobel, Joyce (1999). Writing for Publication, Clinical
Journal of Oncology Nursing, 9(1).
Sheriden Libraries. Writing for Publication: Tools for Getting
Started. (Retrieved from the World Wide Web 10/27/06, at
http://www.library.jhu.edu/researchhelp/general/publishing.html
)
St. James, Deborah (2001). Writing, Speaking &
Communication Skills for Health Professionals. New Haven:
Yale University Press.
US Department of the Health Professions, (2002). Washington