Question: C++ Programing. Use the 3 provided files to complete program . Task 1 is complete. Any help would be greatly appreciated // Programing.cpp : Defines
C++ Programing. Use the 3 provided files to complete program . Task 1 is complete. Any help would be greatly appreciated
// Programing.cpp : Defines the entry point for the console application. // // For each task below, add code to complete the program. Each task is numbered and has an associated point value. // Partial points are available. // Include any libraries and use any methods that you feel are appropriate.
#include "stdafx.h" #include
using namespace std;
//Task 1 - 15 Poiints //Complete the Task_01 function. //Write code that uses string functions to provide appropriate values for the strConcatinated, strSubstring, strReversed, strLargest, strUppercase, strLength variables //When complete, the cout statements should print correctly. void Task_01(string str1, string str2) {
string strConcatinated = ""; string strSubstring = ""; string strReversed = ""; string strLargest = ""; string strUppercase = ""; int strLength = 0;
cout << "Task 1a:" << endl; strConcatinated = str1 + str2; cout << "Concatination: str1 + str2 = " << strConcatinated << endl;
cout << "Task 1b:" << endl; int str1length = str1.length(); int str2length = str2.length(); if (str1length > str2length) { strLargest = str1; strLength = str1length;} else { if (str2length > str1length) { strLargest = str2; strLength = str2length; } } cout << "Comparison: The longest string is = " << strLargest << ". The length is: " << strLength << endl;
cout << "Task1c: " << endl; for (int i = 0; i < strConcatinated.length(); i++) switch (strConcatinated.at(i)) { case 'a': case 'e': case 'i': case 'o': case 'u': break; default: strSubstring += strConcatinated.at(i); } cout << "Substring: The concatinated string with all vowels (a,e,i,o,u) removed is " << strSubstring << endl;
cout << "Task1d: " << endl; strReversed = string(strConcatinated.rbegin(), strConcatinated.rend()); cout << "Reversed: The concatinated string in revered order is " << strReversed << endl;
cout << "Task1e: " << endl; transform(strConcatinated.begin(), strConcatinated.end(), strConcatinated.begin(), toupper); strUppercase = strConcatinated; cout << "Capitalized: The concatinated string converted to all capital letters is " << strUppercase << endl;
}
//Task 2 - 15 Points //Complete the Task_02 function. //Write code that reads the file specified in the strFilePath variable, and uses the data in the file to populte the numberOfLines, longestWord, lineNumofLongestWord, //shortestWord, and lineNumberOfShortestWord variables. //When complete, the cout statements should print correctly. void Task_02(string strFilepath) {
int numberOfLines = 0; string longestWord = ""; int lineNumOfLongestWord = 0; string shortestWord = ""; int lineNumOfShortestWord = 0;
cout << "Task 2a:" << endl; cout << "The file has : " << numberOfLines << " lines. " << endl;
cout << "Task 2b:" << endl; cout << "The longest word in the file is : " << longestWord << ". It is on line " << lineNumOfLongestWord << endl;
cout << "Task 2c:" << endl; cout << "The shortest word in the file is : " << shortestWord << ". It is on line " << lineNumOfShortestWord << endl;
}
//Task 3 - 15 Points //Complete the Task_03 function. //Write code that reads the file specified in the InputFileName variable, and writes only the lines that start with a dollar sign $ to a file //specified by the OutputFileName variable. void Task_03(string InputFileName, string outputFileName) { cout << "Task 3: START: " << endl;
cout << "Task 3: COMPLETE: " << endl; }
//Task 4 - 15 Points //Complete the Task_04 function. //The file specified in the InputFileName variable contains a list of calendar events. //Write code that reads the file specified in the InputFileName variable, and writes the events that start with on a Weekend to the //file specified by the OutputFileName1 variable, and writes the lines that start on a Weekday to the file specified by the OutputFileName2 variable. void Task_04(string InputFileName, string outputFileName1, string outputFileName2) { cout << "Task 4: START: " << endl;
cout << "Task 4: COMPLETE: " << endl; }
int main() { string Task1StringA = "It was the best of times"; string Task1StringB = ", it was the worst of times"; string Task2InputFile = ("\\Task2.txt"); //Change value to the file path to where you saved your Task2.txt file string Task3InputFile = "c:\\KSU\\Task3Input.txt"; string Task3OutputFile = "c:\\KSU\\Task3Output.txt"; string Task4InputFile = "c:\\KSU\\Task4Input.csv"; string Task4OutputFileA = "c:\\KSU\\Task4OutputA.csv"; string Task4OutputFileB = "c:\\KSU\\Task4OutputB.csv";
Task_01(Task1StringA, Task1StringB); Task_02(Task2InputFile); Task_03(Task3InputFile, Task3OutputFile); Task_04(Task4InputFile, Task4OutputFileA, Task4OutputFileB);
cout << "---------------------------------------------------------------------" << endl; return 0; } Task2.txt xanthan xanthate xanthene Xanthian xanthic xanthin xanthine xanthoma xebec xeme xenia xenial xenogamy xenolith xenology xenon xenotime xeric xeroma xerox Xhosa xi Xiang xiphoid Xmas xoanon xography xu xylary xylem xylene xylite xylitol xylol xylose xyrid xyster xyston xystus
Task3Input.txt $aa a kind of volcanic lava that forms jagged masses with a light frothy texture; in an unrelated sense (a stream) aa is the first entry in the Oxford English Dictionary abaya a full-length, sleeveless outer garment worn by Arabs abomasum the fourth stomach of a ruminant, such as a cow or sheep absquatulate to leave somewhere abruptly adscititious additional afreet a powerful jinn or demon in Arabian and Muslim mythology Albertopolis a group of museums and other cultural institutions in South Kensington in London, named after Prince Albert alcazar a Spanish palace or fortress amphibology a phrase or sentence that is grammatically ambiguous, such asShe sees more of her children than her husband amphisbaena a mythical serpent with a head at each end anfractuous winding or circuitous $anguilliform resembling an eel $apoptosis the death of cells which occurs as a normal part of an organism's growth or development $apple-knocker US informal an ignorant or unsophisticated person $argle-bargle copious but meaningless talk or writing $Argus-eyed vigilant, referring to Argos, a Greek mythological watchman with a hundred eyes argute shrewd ariel a gazelle found in the Middle East and North Africa aristotle Austral. rhyming slang a bottle $aspergillum an implement used for sprinkling holy water in religious ceremonies astrobleme an eroded remnant of a large, ancient crater made by the impact of a meteorite or comet Attic salt refined, incisive wit autotomy the casting off of a limb or other part of the body by an animal under threat, such as a lizard badmash Indian a hooligan bandoline a sticky preparation used for setting hair bardolatry humorous excessive admiration of Shakespeare (the Bard of Avon) Barmecide illusory or imaginary and therefore disappointing barn burner N. Amer. a very exciting or dramatic event, especially a sports contest; first used of an exceptionally good hand at bridge. bashment W. Indian a large party or dance bawbee Scottish a coin of low value benthos the flora and fauna on the bottom of a sea or lake bergschrund a type of crevasse $bezoar a small hard, solid mass which may form in the stomachs of animals such as goats or sheep $bibliopole a person who buys and sells books, especially rare ones $bichon frise a breed of toy dog with a fine, curly white coat bilboes an iron bar with sliding shackles, used to fasten prisoners' ankles $bindlestiff N. Amer. a tramp bingle Austral. informal a collision blatherskite a person who talks at great length without making much sense bleeding edge the very forefront of technological development $blind pig N. Amer. informal a place where alcoholic drinks are sold illegally bobsy-die a great deal of fuss or trouble boffola N. Amer. informal a joke that gets a loud or hearty laugh boilover Austral. informal a surprise result in a sporting event borborygmus a rumbling or gurgling noise in the intestines breatharian a person who believes that it is possible, through meditation, to reach a level of consciousness where one can exist on air alone Brobdingnagian gigantic, from Brobdingnag, a country in Jonathan Swift'sGulliver's Travels bruxism involuntary and habitual grinding of the teeth $bumbo a drink of rum, sugar, water, and nutmeg $burnsides a moustache in combination with whiskers on the cheeks but no beard on the chin cacoethes an urge to do something inadvisable callipygian having shapely buttocks callithumpian like a discordant band or a noisy parade camisado a military attack carried out at night canorous melodious or resonant $cantillate to chant or intone a passage of religious text carphology convulsive or involuntary movements made by delirious patients, such as plucking at the bedclothes? Task4Input.csv EVENT TITLE,START DATE,END DATE,DAY OF WEEK,START TIME,END TIME,VENUE NAME,VENUE ADDRESS,VENUE ADDRESS 2,VENUE CITY,VENUE STATE/PROVINCE,VENUE ZIP,VENUE COUNTRY,VENUE PHONE,VENUE WEBSITE Event 1,5/1/2018,5/1/2018,Tuesday,8:00 AM,9:30 AM,Art Institute of Chicago,111 S Michigan Ave,,Chicago,IL,60603,United States,,http://www.artic.edu/ Event 2,5/2/2018,5/2/2018,Wednesday,9:00 AM,10:30 AM,Party Haus,330 S Broadway,Unit 602,Los Angelos,CA,90013,united States,, Event 3,5/3/2018,5/3/2018,Thursday,10:00 AM,11:30 AM,Cambridge University Library,West Road,,Cambridge,,CB3 9DR,United Kingdom,+44 1223 333000,http://www.lib.cam.ac.uk/ Event 4,5/4/2018,5/4/2018,Friday,11:00 AM,12:30 PM,New Brookland Tavern,122 State Street,,West Columbia,SC,29169,United States,(803) 791-4413, Event 5,5/5/2018,5/5/2018,Saturday,12:00 PM,1:30 PM,Musee DOrsay,1 Rue de la Lgion d'Honneur,,Paris,,75007,France,+33 1 40 49 48 14,http://www.musee-orsay.fr/ Event 6,5/6/2018,5/6/2018,Sunday,1:00 PM,2:30 PM,Bamboo Fresh,655 Front St.,#108,Lahaina,HI,96761,United States,, Event 7,5/7/2018,5/7/2018,Monday,2:00 PM,3:30 PM,The Corn Palace,601 N Main St,,Mitchell,SD,57301,United States,,http://cornpalace.com/ Event 8,5/8/2018,5/8/2018,Tuesday,3:00 PM,4:30 PM,San Diego Zoo,2920 Zoo Drive,,San Diego,CA,92101,United States,619-231-1515,http://zoo.sandiegozoo.org/ Event 9,5/9/2018,5/9/2018,Wednesday,4:00 PM,5:30 PM,Doug Fir Lounge,830 E. Burnside St.,,Portland,OR,97214,United States,(503) 231-9663,http://www.dougfirlounge.com/ Event 10,5/10/2018,5/10/2018,Thursday,5:00 PM,6:30 PM,Krispy Kreme,6935 South Lindbergh,,St. Louis,MO,63129,,,https://www.krispykreme.com/ Event 11,5/11/2018,5/11/2018,Friday,6:00 PM,7:30 PM,The Beanery,500 SW 2nd St,,Corvallis,OR,97330,United States,, Event 12,5/12/2018,5/12/2018,Saturday,7:00 PM,8:30 PM,Winchester Mystery House,525 S Winchester Blvd,,San Jose,CA,95128,United States,,http://www.winchestermysteryhouse.com/
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
