Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Business Management Expert

For this exercise you are to write a program (in C or C++ preferably) that reads a text file containing a number of words and displays the words on the screen in reverse order using a stack. An algorithm of the program is shown below:

Begin main

Display a prompt for the file name

Read in the file name

Try to open the file

If the file fails to open

Print an error message on the screen and exit

Loop

Read in a word from the file

If the file read fails, terminate (break) the loop

Push the word onto the stack

End loop

Close the file

While the stack is not empty

Display the top stack word on the screen followed by a space

Pop the top value from the stack

End while

End main

Do not implement the stack using a class or struct or with STL. The stack must be implemented using a fixed size array of words and an index integer for indicating the top of the stack. The stack array and index should be global variables. A word can be a string or a c-string (i.e. a character array). You can assume no word is more than 20 characters long. The stack functions (i.e. push(), top(), pop(), isEmpty() ) should be implemented below the main() and prototyped above the main().

Business Management, Management Studies

  • Category:- Business Management
  • Reference No.:- M92410093
  • Price:- $10

Priced at Now at $10, Verified Solution

Have any Question?


Related Questions in Business Management

If getting tired is associated with workload stressors then

If "getting tired" is associated with workload stressors, then how can emerging leaders balance the demands on their personnel? Secondly, to what extent do you experience "fatigue" associated with this same phenomenon an ...

Can you please direct me on how i should go about

Can you please direct me on how I should go about describing an interview by providing 3 structured behavioral questions? Choose a job that you are interested in. You may relate it to your term project by choosing a movi ...

What are some examples of when a data compression utility

What are some examples of when a data compression utility can be used for information stored on a computer's hard drive?

What is norways global health issues and how can they be

What is Norway's global health issues and how can they be combated?

A very important client bob is in town and his expenses are

A very important client, Bob, is in town and his expenses are being covered by XYZ company. This client controls a large portion (over 50%) of the business XYZ company does each year. When he submits his expense report, ...

How do you apply the five components of the information

How do you apply the five components of the information systems to an information systems application like "online bill pay" system offered by many banks.

What could be potential barriers to communication with

What could be potential barriers to communication with clients? How can you deal with those barriers?

Long-term objectives are defined as the result a firm seeks

Long-term objectives are defined as the result a firm seeks to achieve over a specified period, typically five years. Any long-term objectives should be flexible, measurable over time, motivating, suitable, and understan ...

What are the corporate managerial influences of employing

What are the corporate managerial influences of employing and implementation of business ethics?

Discuss the different characteristics of a group goal

Discuss the different characteristics of a group (goal orientation, interdependent, interpersonal interaction, perception of membership, structured relations, mutual influence, and individual motivation) and give example ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As