Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Business Economics 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 Economics, Economics

  • Category:- Business Economics
  • Reference No.:- M92405250
  • Price:- $10

Priced at Now at $10, Verified Solution

Have any Question?


Related Questions in Business Economics

The food marketing institute shows that 16 of households

The Food Marketing Institute shows that 16% of households spend more than $100 per week on groceries. Assume the population proportion is  p  = 0.16 and a sample of 600 households will be selected from the population. Us ...

A national report indicates that the mean and standard

A national report indicates that the mean and standard deviation of the ACT scores of incoming freshman at American public universities are 24.6 and 6.2, respectively. A sample of 30 incoming freshmen at a small, suburba ...

Coach steroid likes his players to be big fast and obedient

Coach Steroid likes his players to be big, fast, and obedient. If player  A  is better than player  B  in two of these three characteristics, Steroid will prefer  A  to  B . Three players try out for quarterback. Wilbur ...

Case a motivationas the provincial manager for a financial

Case A Motivation As the Provincial Manager for a financial services firm, you are well regarded within your company and especially by many of the 82 employees who work within your division. Due to a downturn in business ...

In a survey of women in a certain country ages 20-29 the

In a survey of women in a certain country? (ages 20-?29), the mean height was 65.3 inches with a standard deviation of 2.71 inches. Answer the following questions about the specified normal distribution. ?(a) What height ...

Qxd 14 - 12 pxnbspnbspnbspandnbspqxs 14pxnbsp-

QXd = 14 - (1/2) P X    and QXS = (1/4)P X  - 1 a. Determine the equilibrium price and quantity. Show the equilibrium graphically. b. Suppose a $12 excise tax is imposed on the good. Determine the new equilibrium price a ...

Suppose that the government is coming up with an employment

Suppose that the government is coming up with an employment protection policy that requires firms to pay each laid-off worker two more months of salary after they are laid off. This essentially changes the variable adjus ...

What is the usefulness of the total revenue test for price

What is the usefulness of the total revenue test for price elasticity of demand? What are the factors that affect price elasticity of demand and price elasticity of supply? What are some applications of each?

What effect does the teacher have on creating a learning

What effect does the teacher have on creating a learning environment with little to no behavior problems?

Carefully explain how the negative price elasticity of

Carefully explain how the negative price elasticity of demand affect the revenue or profit of an organization?

  • 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