Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that reverses a text file by using a stack. The user interface must consist of 2 list boxes and 3 buttons. The

Write a program that reverses a text file by using a stack. The user interface must consist of 2 list boxes and 3 buttons.

The 3 buttons are:

Read - reads the text file into list box 1.

Reverse - reverses the items in list box 1 by pushing them onto stack 1, then popping them from stack 1 (in the reverse order) and adding them to list box 2.

Write - writes the contents of list box 2 to a new text file.

At first, only the Read button is enabled. After it is clicked, it is disabled and the Reverse button is enabled. After it is clicked, it is disabled and the Write button is enabled. After it is clicked, it is disabled.

The name of the input text file is "input.txt". The input text file will contain no more than 100 lines of text. This fact is not needed by the program. It simply means that memory usage is not an issue.

The name of the output text file is "output.txt".

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

122. If X is distributed as N(0, 1), find the pdf of .

Answered: 1 week ago