c programming ( putty )

there is some errors  in the attachement file if any one can fix it 

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

the program is not opening the text file 

using ( microsoft ) 

putty

 

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

need it ASAP

AC 222 – Article or Research assignment #2


General Requirements:

You will be required to select and bring into class a article. You must be prepared to discuss it and hand in a two page, plus cover document. Articles must relate and be relevant to the materials handed out in this course. The articles can come from on-line, magazine or newspaper sources, and they should contain enough information to address the points stated below.


Specific Requirements
For Article #2:

The article must relate to Sales Promotion and the emergence/explosion of online & mobile capabilities for this marketing communication method…so far!


Recommended sources:

www.prnewswire.com

www.ddimagazine.com

www.instoremarketer.org

www.promotionlink.com

www.reveries.com

http://www.bizjournals.com/

http://www.theipm.org.uk/Home.aspx

http://promomagazine.com/

http://www.couponinfonow.com/coupons/


How to submit:

. Sign in into your Microsoft SkyDrive Account (Create one (if not done already) at

http://explore.live.com/skydrive

) – This will give 25Gig Free of Cloud Storage.

. Upload your submission as a
WORD Document
under My Documents Folder onto your SkyDrive Account

. Once uploaded, select the document and click on Share on the right side of the screen

. Click on “Get A Link” on the left and then “Get A Link” under “View and Edit”, on the right

. Copy this link and past it into the textbox of your DropBox for this assignment into Angel

. You are all set!

. Your grade for this assignment will be communicated on Angel (in the appropriate DropBox on Angel) and the comments of your professor will be directly indicated onto your document in SkyDrive.

IMPORTANT: No paper or Angel DropBox upload or email attachments submissions will be accepted – Submission has to be in MS Word (No PDF, No Google Doc, No Open Source format. No Apple format).

Press Releases are not acceptable.

Formatting requirements:

Each article or research analysis should follow this format and include the following items if you wish to receive full credit:

A) Article summary (1 page)

Main purpose of this article:

What is the author intent in writing this article? What is the author trying to accomplish?

The key question that the author is addressing:

The most important information in this article:

What the key information that the author uses, presupposed, in the article to support his/her main arguments. You need to look for facts, experiences, and/or data the author is using to support his/her conclusions

The main conclusions in this article:

You want to identify the most important conclusions the author comes to and presents in the article

The key concepts we need to understand in this article:

You need to identify these marketing, marketing communications and sales promotion ideas or concepts or principles that help to understand the line of reasoning of the author.

The main assumptions(s) underlying the author’s thinking:

What is the author taking for granted? The assumptions are generalizations that the author does not think he/she has to defend. They might be unstated.

The main point of view presented in this article is (are):

What is the author looking at, and how is he/she seeing it?

B) Your own assessment/opinion (1 page):

Formalized/additional background information:

Background information on the company and the industry environment.

Briefly describe the company’s product-line or services offered, its marketing activities, its key competitors, etc. as appropriate (additional research may be required for this)

Marketing strategy:

State and describe what marketing target(s), what marketing objective(s), what value proposition do you think the company has (additional research may be required for this)

Sales promotion:

Describe the SP offer in question. State and describe the sales promotion objective(s), sales promotion target(s), sales promotion desired result(s), sales promotion technique(s) and online or internet capability/ies that was/were used.

Your assessment:

Do you think that the use of those new online or mobile capabilities augmented or reduced the effectiveness of this campaign? In the end, how would you rate the effectiveness of this Sales Promotion? Why?

Propose any adjustments to the SP component of the campaign to make it even more effective, if appropriate

ARTICLE:

Attach the magazine, newspaper or web site article to your 2 pages

summary, with cover page.

IMPORTANT:

At the instructors’ discretion, students will be selected to lead the class with

their current event article.

The assignment will be graded with the “AC 222 Rubric based- Article analysis” grading guide lines

####

#include
#include
#include
typedef struct book_type {
char title[100],authorFirstName[100],authorLastName[100];
int year;
float rCost;
}node;
// This function loads a catalogue of books from a user specified file name.
// Note you need to use malloc inside this function to allocate the memory
// needed for the catalogue of books.
// After catalogue is allocated and filled up with books loaded from the file,
// it is returned back to the main program via the book_type * return type.
// The pointer parameter numBooks is used to pass the number of books back
// out to the numBooks variable in the main function. This way the other
// functions will be able to use this variable to find how many books
// are stored in the catalogue.
struct book_type * loadCatalogue(int * numBooks);
// This function saves catalogue into a user specified text file
void saveCatalogue(struct book_type * bCatalogue, int numBooks);
// This function displays the catalogue onto the screen.
void displayCatalogue(struct book_type * bCatalogue, int numBooks);
// This function finds a user specified book or set of books and displays them
void findBook(struct book_type * bCatalogue, int numBooks);
//This function finds a user specified book or set of books and deletes them
struct book_type * deleteBook(struct book_type * bCatalogue, int numBooks);
int main() {
struct book_type * bookCatalogue=NULL;
int numBooks,choice=0;
//This loop goes on untill the user gives 6 as a choice
while(choice!=6){
printf(“\nChoose one of the following options:\n1. Load catalogue from file\n2. Save catalogue to file\n3. Display catalogue\n4. Find book from catalogue\n5. Delete book from catalogue\n6. Quit\n”);
scanf(“%d”,&choice);
fflush(stdin);
switch(choice){
case 1:
bookCatalogue = loadCatalogue(&numBooks);//calls the load catalogue function
break;
case 2:
saveCatalogue(bookCatalogue, numBooks);//calls the function to save the catalogue
break;
case 3:
displayCatalogue(bookCatalogue, numBooks); // calls the function to display the catalogue on screen
break;
case 4:
findBook(bookCatalogue, numBooks); //calls the function to search for a book in a catalogue
break;
case 5:
bookCatalogue = deleteBook(bookCatalogue, numBooks); //calls the function to delete a book from the catalogue
break;
case 6:
printf(“Program will exit now\n”);
break;
default:
printf(“Wrong option selected, please select again\n”); // If user gives an invalid input, ask him to re-enter
break;
}
}
return 0;
}
struct book_type * loadCatalogue(int * numBooks) {
struct book_type *bCatalogue;
char fileName[100],line[100];
int i=0;
FILE *fp;
bCatalogue=(node *)malloc(sizeof(node)); //allocate memory
printf(“Enter the name of the file to open:\n”);
gets(fileName);// Take filename as input
//fflush(stdin);
fp=fopen(fileName,”r”);//opens the file in read only mode
if(fp==NULL){//If file cannot be opened due to some reason than print the error
perror(fileName);
return NULL;
}
while ( fgets ( line, sizeof(line), fp ) != NULL ) /* read a line */
{
//First line represents the number of books
if(!i)
{
sscanf(line,”%d”,&numBooks);
continue;
}
//Take different attributes of book and place them in proper variables.
if((i-1)%4==2)
{
sscanf(line,”%s”,bCatalogue[i/4].title);
}
//Since first name and last name are in the same line, we need to split it from ‘,’
else if((i-1)%4==3)
{
char fName[100],lName[100];
int j;
for(j=0;line[j]!=’,’;j++)
{
fName[j]=line[j];
}
fName[j++]=’\0′;
for(;line[j]!=’\0′;j++)
{
lName[j]=line[j];
}
lName[j]=’\0′;
sscanf(fName,”%s”,bCatalogue[i/4].authorFirstName);
sscanf(fName,”%s”,bCatalogue[i/4].authorLastName);
}
else if((i-1)%4==0)
{
sscanf(line,”%d”,&bCatalogue[i/4].year);
}
else if((i-1)%4==1)
{
sscanf(line,”%f”,&bCatalogue[i/4].rCost);
}
i++;
}
fclose ( fp );
return bCatalogue;
}
void saveCatalogue(struct book_type * bCatalogue, int numBooks) {
if(bCatalogue==NULL)
printf(“Please load the the book catalogue first\n”);
else
{
char fileName[100], name[200],output[20];
FILE *fp=NULL;
int i=0,j=0,k=0;
printf(“Enter the name of the file to save:\n”);
gets(fileName);
fp=fopen(fileName,”w”);//open a new file in write only mode
if(fp==NULL){
perror(fileName);
}
else
{
sprintf(output,”%d”,numBooks);
fputs(output,fp);
fwrite(“\n”, sizeof(char), 1, fp);
while(i<4*numBooks) { fputs(bCatalogue[i/4].title,fp); fwrite("\n", sizeof(char), 1, fp); for(;bCatalogue[i/4].authorFirstName[j]!='\0';j++) name[j]=bCatalogue[i/4].authorFirstName[j]; name[j]=','; name[++j]=' '; for(;bCatalogue[i/4].authorLastName[k]!='\0';k++,j++) name[j]=bCatalogue[i/4].authorLastName[k]; name[j]='\0'; fputs(name,fp); fwrite("\n", sizeof(char), 1, fp); sprintf(output,"%d",bCatalogue[i/4].year); fputs(output,fp); fwrite("\n", sizeof(char), 1, fp); sprintf(output,"%f",bCatalogue[i/4].rCost); fputs(output,fp); fwrite("\n", sizeof(char), 1, fp); i++; } } fclose(fp);//close the file } } void displayCatalogue(struct book_type * bCatalogue, int numBooks) { if(bCatalogue==NULL) printf("Please load the the book catalogue first\n"); else { int i=0; printf("Number of books in catalogue = %d\n---------------------------------------------------------------\n",numBooks); while(i

Still stressed with your coursework?
Get quality coursework help from an expert!