Question
Your assignment is to develop a system to import ASCII art from a file or to create ASCII art manually. Each file will have a
Your assignment is to develop a system to import ASCII art from a file or to create ASCII art manually. Each file will have a variable number of inputs (in no order). Each line in a file will have two integers (the x and y coordinates) and a character to display in the position. Each image will be displayed in a 75 x 75 square. The input files will look like this: Figure 2. Sample Input File (Fish) You will have to load in the file into a two-dimensional array and then display it. This example is a simple fish. Because we are using a 75x75 grid (they should be constants), there will be a lot of empty spaces around our fish (which is fine). 0 1 2 3 0 _ 1 > < _ > Figure 3. Output of Sample Input File (Fish) 4. Requirements: This is a list of the requirements of this application. For this project, it is up to you exactly how you want to implement it. For you to earn all the points, however, you will need to meet all the defined requirements. You must follow the coding standard as defined in the CMSC 202 coding standards (found on Blackboard under course materials). This includes comments as required. The project must be turned in on time by the deadline listed above. The project must be completed in C++. You may not use any libraries or data structures that we have not learned in class. These are the only libraries that you are allowed to use in this project - , , , , and . YYou may NOT use . You should only use namespace std. You must use a variety of functions (at least 5) including passing parameters to those functions and returning information from those functions. At least one time, an array must be passed to a function (although you may do this more than once). The menu must be implemented with a switch statement. All user input must be validated. For example, if a menu allows for 1, 2, or 3 to be entered and the user enters a 4, it will re-prompt the user. However, the user is expected to always enter the correct data type. i.e. If the user is asked to enter an integer, they will. If they are asked to enter a character, they will. You do not need to worry about checking for correct data types. The name of the input file is variable. As a hint, dont forget that the open command must use a c-string. You are not allowed to use in this project. You must use at least one multi-dimensional array in this project. Have a main menu that asks if the user wants to: o Load a file of ASCII art data (4 test files have been provided including proj1_pic1.txt, proj1_pic2.txt, proj1_pic3.txt, and proj1_pic4.txt. o Create ASCII Art manually where the user enters an X and Y coordinate and then a character for that location. They should be able to manually edit a previously loaded file (although it will not permanently change in the input file). o Display the art. o Rotate the art 90 degrees to the clockwise. Some images will not make sense rotated (proj1_pic1.txt is a bad example). However, if you rotate any of the pictures 4 times, they should be identical to the way they started. o Invert the art both vertically or horizontally. Vertical should display like the image was rotated twice. For example, the fish from proj1_pic1.txt should go from the upper left corner to the bottom right corner. Horizontal should display the image backwards. For example, the fish from proj1_pic1.txt should go from the upper left corner to the upper right corner and backwards (it will look strange). o Exit and include a thank you message for the user Specific coding requirements include: o Must use at least 5 different functions. o Must use at least two different arrays. o Must pass an array to a function. o Must read in a file into a two-dimensional array. o Must use at least one switch statement. o Must use input validation (assume the data is the correct type). o Must use at least one do..while loop. o Must use constants as needed. 5. Recommendations You are free to implement this with your own functions. While not required, these are some functions that you may want to include: o Main Menu Welcomes the user to the application and has the user choose between loading a data file, creating the art manually, displaying the art, rotating the art, inverting the art (vertical or horizontal), or exiting. o Load ASCII Art from File Prompts the user for the name of the input files then displays the data loaded. o Create ASCII Art Manually Allows the user to enter x and y coordinate and a character to update the current art (could be new or loaded from a file) o Rotate Art Rotates the art 90 degrees clockwise o Invert Art Calls invertHorizontal or invertVertical which do as described above. 6. Sample Input and Output For this project, input files are very simple. What would you like to do? 1. Load ASCII Art from File 2. Create ASCII Art Manually 3. Display Art 4. Rotate Art 5. Invert Art 6. Exit 4 What would you like to do? 1. Load ASCII Art from File 2. Create ASCII Art Manually 3. Display Art 4. Rotate Art 5. Invert Art 6. Exit 3 > < __ >
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started