Algorithm of the program

Assignment Help Business Management
Reference no: EM131601380

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().

Reference no: EM131601380

Questions Cloud

The nasws social work core values and waldens mission : Consider the similalites between the NASW'S Social Work core values and Waldens mission and vision.
Configuration and troubleshooting of complex : Explain and demonstrate competence in the configuration and troubleshooting of complex EIGRP networks
Generate a random number between 0 and 4 : Add a function to get the current date and time. Write the date on the page in a user friendly format. Use a switch statement to write an appropriate greeting
How the economy impacts on peoples behaviour : You may want to consider for instance how the economy impacts on people's behaviour - ask how that then will have consequences for the hotel chain?
Algorithm of the program : 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.
Define the equal to a criminal enterprise : In sum, are monopolies simply a component of free market capitalism, or are they equal to a criminal enterprise
Recommend for sam home-based office : What firewall configuration would you recommend for Sam's home-based office/network? Justify your response.
Discuss how incidents or accidents have been brought : discuss how incidents or accidents have been brought about due to bad maintenance practices in the aviation industry.
Code to read a csv file : You have the code to read a .csv file but now you need to prompt the user to pick an option 1-5 - Next you have to assoicate the users input with the answer

Reviews

Write a Review

Business Management Questions & Answers

  Caselet on michael porter’s value chain management

The assignment in management is a two part assignment dealing 1.Theory of function of management. 2. Operations and Controlling.

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. Due to increase in the preference for light beer drinkers, Chris Prangel wants to introduce light beer version in Mountain Man. An analysis into the la..

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. An analysis into the launch of Mountain Man Light over the present Mountain Man Lager.

  Analysis of the case using the doing ethics technique

Analysis of the case using the Doing Ethics Technique (DET). Analysis of the ethical issue(s) from the perspective of an ICT professional, using the ACS Code of  Conduct and properly relating clauses from the ACS Code of Conduct to the ethical issue.

  Affiliations and partnerships

Affiliations and partnerships are frequently used to reach a larger local audience? Which options stand to avail for the Hotel manager and what problems do these pose.

  Innovation-friendly regulations

What influence (if any) can organizations exercise to encourage ‘innovation-friendly' regulations?

  Effect of regional and corporate cultural issues

Present your findings as a group powerpoint with an audio file. In addition individually write up your own conclusions as to the effects of regional cultural issues on the corporate organisational culture of this multinational company as it conducts ..

  Structure of business plan

This assignment shows a structure of business plan. The task is to write a business plane about a Diet Shop.

  Identify the purposes of different types of organisations

Identify the purposes of different types of organisations.

  Entrepreneur case study for analysis

Entrepreneur Case Study for Analysis. Analyze Robin Wolaner's suitability to be an entrepreneur

  Forecasting and business analysis

This problem requires you to apply your cross-sectional analysis skills to a real cross-sectional data set with the goal of answering a specific research question.

  Educational instructional leadership

Prepare a major handout on the key principles of instructional leadership

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd