![]() o o Your program should be able to handle upper-case or lower-case letters A-F, a-f There is a simple trick you can do with a switch statement to make this easy You should not handle this by relying on a library call to force upper-case or lower-case You may write YOUR OWN function to do this if you like though If the user doesn't run the program with proper command-line syntax, you should report an error and give them proper usage You should not be doing the file I/O one character at a time Your output should have the same line structure as the input i.e. If a character is passed in other than 0 - 9, A - F return "eeee" Prototype: const char* hexToArt(char) Very simple input -> output function that will give you a short string literal that you can write to your output file. Syntax: Sample art creation call: hexArt info.txt -a art.txt Sample inverter call: hexArt art.txt -i invArt.txt Required Function: You should create a function called hexToArt that takes a character as a parameter and returns a string literal representation as shown above. It will work entirely as a command line utility. The maximum size for a row for this part is: 1020 (255 * 4) Requirements: Command line interface: This program will not have any menu interface. If you read a character that is not # or - then simply output an E for error. ![]() again, you only need a single C-Style String for this. #- #-#-# -# - #- #-# Once This is going to be another Row-by-Row, character-by-character algorithm. Part B - Invert an already created Art File In Part B, you'll read an already created ASCII art file and invert the characters. Other than the C-Style String for input, you are NOT TO USE any other arrays (we haven't learned them yet). This is a Row-by-row, character-by-character algorithm. Process through each character in the line to translate that character into the appropriate ASCII-binary pattern. Read the file a line at a time as a C-Style String (character array that ends in \0). There can be any number of lines in the file. Each line will be no more than 255 characters in length. The input file will be several lines of appropriate characters. ![]() ![]() 1A2B â "-#-#-#-#-#" You will be reading the numerical sequence from a file and outputting the ASCII art to a file. ![]() This means that you will be translating something small into something bigger. Fâ "#" Each character translates to their appropriate Binary pattern but represented as a short 4 character string of dashes and # characters. You can use This program will read an input file which will have lines of characters that represent a single 4-bit HEX number: 0-9, A-F You will process through each line one character at a time to output a simple sequence. Part 3 - Programming Assignment Part A - Hex to ASCII Art You are going to create a program that makes some simple ASCII art! C or C++ for this assignment. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |