Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program to display an image, which is just ASCII art, and give some options to manipulate it. Present a menu to the

Write a C++ program to display an image, which is just ASCII art, and give some options to manipulate it. Present a menu to the user for this program. The menu should look like the following, and should be displayed until the user chooses to exit the program:

Welcome to TxPaint

[1] Load image

[2] Draw line in image

[3] Save image

[4] Exit

Option 1 - Program should load an image from a file. The filename can be hard-coded, so you dont have to prompt the user for this information. Load this image into a single-dimensional array and display the image to the screen.

Option 2 - Prompt the user to choose either a vertical or horizontal line. Using the image loaded in add the line either horizontally or vertically and display the altered image. If the image is not already loaded, load it first. The line should be displayed halfway across the image. For vertical lines, use the pipe | character, and for horizontal lines, use the dash - character.

Option 3 - Save the image that is currently stored in memory to a file. Save with a new filename such as image-new.asc so you dont overwrite the original image that may be loaded if the user chooses one of the options again.

Option 4 - Exit the program

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

Students also viewed these Databases questions

Question

Computer Science - What is backtracking in data structures?

Answered: 1 week ago