Question: C++ Program help. I need urgent help. Please create a c++ program exactly according to the specifications of this link:: https://drive.google.com/file/d/1f4BAtOAsbbFFIIqwtJ-ub2d-i1T8Twtt/view Here is the text
C++ Program help. I need urgent help. Please create a c++ program exactly according to the specifications of this link::
https://drive.google.com/file/d/1f4BAtOAsbbFFIIqwtJ-ub2d-i1T8Twtt/view
Here is the text you must coppy and paste to an input file ascii_data.txt:
Fluffy Bunny 41123 , /| __ / | ,-~ / Y :| // / | jj /( .^ >-"~"-v" / Y jo o | ( ~T~ j >._-' _./ / "~" | Y _, | /| ;-"~ _ l / l/ ,-"~ \ \//\/ .- \ Y / Y Row l I ! ]\ _\ /"\ (" ~----( ~ Y. ) ===== https://www.asciiart.eu/animals/bunny Animal Row Lazy Bear 2245 _,-""`""-~`) (`~_,=========\ |---,___.-.__,\ | o \ ___ _,,,,_ _.--. \ `^` /`_.-"~ `~-;` \ \_ _ .' `, | |`- \'__/ / ,_ \ `'-. / .-""~~--. `"-, ;_ / | \ \ | `""` \__.--'`"-. /_ |' `"` `~~~---.., | jgs \ _.-'`-. \ \ '. / `"~"` ===== https://www.asciiart.eu/animals/bears Animal Joan Stark Cat 3141 |\ _,,,---,,_ ZZZzz /,`.-'`' -. ;-;;,_ |,4- ) )-,_. ,\ ( `'-' '---''(_/--' `-'\_) Felix Lee ===== https://www.asciiart.eu/animals/cats Animal Felix Leeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee Planet Express 4242 `. ___ __,' __`. _..----....____ __...--.'``;. ,. ;``--..__ .' ,-._ _.-' _..-''-------' `' `' `' O ``-''._ (,;') _,' ,'________________ \`-._`-',' `._ ```````````------...___ '-.._'-: ```--.._ ,. ````--...__\-. `.--. `-` ____ | |` `. `. ,'`````. ; ;` `._`. __________ `. \'__/` `-:._____/______/___/____`. \ ` | `._ `. \ `._________`-. `. `.___ SSt `------'` ===== https://www.asciiart.eu/space/spaceships Spaceship Lunar lander 596 /___.`--.____ .--. ____.--( .'_.- ( ) -._'. .'.' |'..'| '.'. .-. .' /'--.__|____|__.--'\ '. .-. (O).)-| | \ | | / | |-(.(O) `-' '-'-._'-./ \.-'_.-'-' `-' _ | | '-.________.-' | | _ .' _ | | | __ | | | _ '. / .' ''.| | / \ | |.'' '. \ | |( )| '. || || .' |( )| | \ '._.' '. | \ / | .' '._.' / '.__ ______'.|__'--'__|.'______ __.' .'_.-| |------| |-._'. //\\ | |--::--| | //\\ // \\ | |--::--| | // \\ // \\| /|--::--|\ |// \\ / '._.-'/|_______/ |--::--| \_______|\`-._.' \ / __..--' /__|--::--|__\ `--..__ \ / / '-.|--::--|.-' \ \ / / |--::--| \ \ / / |--::--| \ \ _.-' `-._ _..||.._ _.-` '-._ '--..__..--' LGB '-.____.-' '--..__..-' ===== https://www.asciiart.eu/space/spaceships Spaceship lgbeard NEXT is the header file that I partially created please complete it::::
#pragma once #include #include #include #include #include using namespace std; class AsciiImage { public: AsciiImage(); bool LoadImage(ifstream &file); void PrintImage(bool showTitle, bool showName, bool showID, bool showCateg, bool showURL); private: // Your private variables go here. void PrintHorizontalBorder(); void PrintWithVerticalBorders(string s); }; Next is the AsciiImage.cpp file I created please complete it::::
#include "AsciiImage.h" AsciiImage::AsciiImage() { // Add defaults here } bool AsciiImage::LoadImage(ifstream &file) { // Load title // Get ID // Read image // Read URL // Maybe read a name return true; } void AsciiImage::PrintImage(bool showTitle, bool showName, bool showID, bool showCateg, bool showURL) { // Print the image with the board and options } void AsciiImage::PrintHorizontalBorder() { // Print the horizontal border } void AsciiImage::PrintWithVerticalBorders(string s) { // Print the string s with "|" on both sides } Next is the AsciiArtGallery.cpp I created please complete it:::
// AsciiArtGallery.cpp : Defines the entry point for the console application. // #include "AsciiImage.h" /* * This function has already been completed for you. */ int GetUserChoice(bool options[], int maxSz); int main() { vector images; ifstream file; string filename; cout << "Enter Gallery File: "; cin >> filename; filename = "ascii_data.txt"; file.open(filename); // Code to load each image entry goes here... while (!file.eof()) { AsciiImage *imgEntry = new AsciiImage; if(imgEntry->LoadImage(file)) images.push_back(imgEntry); } bool options[5]; cout << endl; cout << "Please enter your image choice and display options (0 or 1)." << endl; cout << "> ImageIndex ShowTitle ShowName ShowID ShowCategory ShowURL" << endl; cout << endl; cout << "ExampleUsage:" << endl; cout << "> 0 1 1 1 1 1 Shows image 0 with title, artist name, image id, category, url" << endl; cout << "> 0 1 1 0 0 0 Shows image 0 with title and artist name" << endl; cout << endl << endl; while (true) { int choice = GetUserChoice(options, images.size()); if (choice < 0) break; images[choice]->PrintImage(options[0], options[1], options[2], options[3], options[4]); } return 0; } int GetUserChoice(bool options[], int maxSz) { int choice = -1; while (true) { cout << "> "; cin >> choice; for (int i = 0; i < 5; i++) { cin >> options[i]; } if (choice < maxSz) break; else { cout << "Please enter an image number between 0 and " << (maxSz - 1) << "." << endl; } } return choice; } FINISH EVERYTHING
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
