Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For the final project, you are required to submit a zip file named ` paint . zip ` containing at least three ` . c
For the final project, you are required to submit a zip file named paintzip containing at least three c files and two h files, along with a Makefile to compile everything into an executable named paintout The project involves implementing a textbased version of paint, focusing on various topics covered in class, excluding recursion. The program heavily emphasizes the use of pointers and realloc The program's overview involves displaying the current canvas, allowing the user to enter commands, and executing those commands until the user enters a quit command. The program should accept up to two commandline parameters indicating the number of rows and columns in the starting canvas. If no parameters are given, an incorrect number of arguments is provided, or invalid values are entered, the canvas defaults to a x size. User commands, entered via standard input, include: quit: Ceases program execution and frees dynamically allocated memory. help: Displays help information using a predefined function in printstatements.c write startrow startcolumn endrow endcolumn: Draws lines based on specified coordinates and characters. erase row col: Erases the character at the specified row and column. resize numrows numcols: Resizes the canvas to the specified dimensions. add r c position: Adds a new row or column at the specified position. delete r c position: Deletes a row or column at the specified position. save filename: Saves the current canvas to a file. load filename: Loads a canvas from a specified file. Assumptions include handling invalid input by prompting the user for a new command until valid input is received. New requirements include using at least one struct meaningfully and organizing the solution into three c files and two h files. Breaking these requirements results in a zero on the assignment. The program must have comments at the top describing its functionality and comments for each function, explaining their purpose and parameter meanings. A minimum of userdefined functions is required, and the use of global variables is prohibited. Example samplerun paintout Enter your command: w Enter your command: w Enter your command: w Enter your command: w Enter your command: w
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started
For the final project, you are required to submit a zip file named paintzip containing at least three c files and two h files, along with a Makefile to compile everything into an executable named paintout The project involves implementing a textbased version of paint, focusing on various topics covered in class, excluding recursion. The program heavily emphasizes the use of pointers and realloc
The program's overview involves displaying the current canvas, allowing the user to enter commands, and executing those commands until the user enters a quit command. The program should accept up to two commandline parameters indicating the number of rows and columns in the starting canvas. If no parameters are given, an incorrect number of arguments is provided, or invalid values are entered, the canvas defaults to a x size.
User commands, entered via standard input, include:
quit: Ceases program execution and frees dynamically allocated memory.
help: Displays help information using a predefined function in printstatements.c
write startrow startcolumn endrow endcolumn: Draws lines based on specified coordinates and characters.
erase row col: Erases the character at the specified row and column.
resize numrows numcols: Resizes the canvas to the specified dimensions.
add r c position: Adds a new row or column at the specified position.
delete r c position: Deletes a row or column at the specified position.
save filename: Saves the current canvas to a file.
load filename: Loads a canvas from a specified file.
Assumptions include handling invalid input by prompting the user for a new command until valid input is received. New requirements include using at least one struct meaningfully and organizing the solution into three c files and two h files. Breaking these requirements results in a zero on the assignment.
The program must have comments at the top describing its functionality and comments for each function, explaining their purpose and parameter meanings. A minimum of userdefined functions is required, and the use of global variables is prohibited. Example samplerun
paintout
Enter your command: w
Enter your command: w
Enter your command: w
Enter your command: w
Enter your command: w
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started