Question: home / study / engineering / computer science / computer science questions and answers / CONCEPTS Stacks Files Write A Program That Reads A Text
home / study / engineering / computer science / computer science questions and answers / CONCEPTS Stacks Files Write A Program That Reads A Text File (provided) And Then Prints ...
Your question has been answered
Let us know if you got a helpful answer. Rate this answer
Question: CONCEPTS Stacks Files Write a program that reads a text file (provided) and then prints to a ...
CONCEPTS
Stacks
Files
Write a program that reads a text file (provided) and then prints to a separate text file all the data, but in reverse order. The resulting file should be the best movie quotes from Steel Magnolias (https://www.imdb.com/title/tt0098384/)
STACK CLASS(should have private and public functions) You will have a header file that contains a Stack class specification and member function definitions. This should be a template class that can accept any data type. The stack should be implemented using a linked list. The Stack class should have the following member functions:
Constructor
Push
Pop
isEmpty
Name your program fileReverser.cpp.
Your program should use the Stack class. In order to write a text file in reverse to a separate file, you will have to open the text file (named file1.txt) and read its contents into a stack of characters. Then, pop those characters from the stack and save them in a second text file (named file2.txt). This resulting file should contain a readable file of Steel Magnolias movie quotes.
WHAT TO TURN IN
fileReverser.cpp
Stack.h
file1.txt
file2.txt
here is file 1: .yenom dna syob tub gnihtyreve pu kcip I ,moor siht ni yticirtcele citats hcum os s'erehT :yvurT .eulav ecaf ruoy sesaercni tI !elimS :yvurT .'nippoh-rab og dna snun sa pu sserd dluow I dna sdneirf ym fo hcnub a ,loohcs ni saw I nehW .eurt ton si taht woN :xuaerduoB resiuO .efil reh ni gniht suoigiler a enod reven s'reisuO .serac ehs ekil hO :rehcleB eerialC !droL eht fo esuoh eht ni era eW :ellennA .ezirossecca ot ytiliba ruo si slamina eht morf su setarapes taht gniht ylno ehT :rehcleB eerialC .etsaw ot gniht elbirret a si dnim ytrid A :xuaerduoB resiuO .flesym pleh t'ndluoc I erof' hctib a fo nos eht ta delims I dna ,ylggiW ylggiP eht ta gninrom siht notnetaE murD was I !ti nmaD .tnasaelp m'I :xuaerduoB resiuO .emit ruoy ypucco ot syaw dnif dluow uoy fi nosrep tnasaelp ,detnetnoc erom hcum a eb dluow uoy ,wonk uoY :rehcleB eerialC !ssa-trams eurt a ekil nekopS !ellennA ,doog yreV :rehcleB eerialC !tisiv tsrif ruoy no toN :ellennA !nekcihc evil a tae em ekam ylbaborp d'yehT !tahw-swonk-ylno-doG 'niod sretaeb-elbiB esoht lla htiw slaviver-tnet esoht fo eno ro sehcruhc ruoy fo eno ot emoc ot em tcepxe uoy t'nod lleW !hO :xuaerduoB resiuO !gnola lla siht detcepsus I :ellennA .deifsitas er'uoy epoh I ,ti dias I ,erehT !od I ,lleW !yarp I ,ellennA ,seY :xuaerduoB resiuO .ecaf ruoy ssorca 'nihcram si ti ezilaer uoy yllautneve dna no sehcram emit ,yenoH :yvurT .no klaw I dnaskciuq eht spihsrow ehs ;em ta dam yats reven dluoc resiuO :rehcleB eerialC .roloc erutangis ym si kniP :yblehS .daeh eht ni tih tog ehS .ti tbuod I :eerialC ?truh ehs saW :yvurT .suolubaf saw tI .llabesab a htiw tih tog reteM naV ecinaJ :eerialC ?og taht did woh ,haeY :yvurT .krap s'nerdlihc wen eht fo noitacided eht ot neeb tsuj ev'I :eerialC .ssa fo eceip doog a ekil 'nihtoN .resiuO sknaht ,wwA :murD ]ekac ollidamra na fo eceip liat eht mih secils resiuO[ ?ekac fo eceip a teg ot em rof hguone gnol ecurt a llac ew nac ,resiuO :murD .egaggul ym naht erom ay evol I :rehcleB eerialC .noitome etirovaf ym si sraet hguorht rethguaL :yvurT .rellik laires a fo 'nitirwdnah eht evah uoY .erehwyna pihsnamnep siht ezingocer d'I ,resiuO :rehcleB eerialC !resiuO ta kcahw a ekat ot hteet eye rieht evig d'hsiraP nipauqihC 'o flaH !emitefil a fo ecnahc eht dessim tsuj uoy ,nnyL'M :eerialC !em 'o og teL ]yawa sehctans[ :xuaerduoB resiuO !nnyL'M ,tuo sthgil reh kconK !nam wollef ruoy rof gnihtemos od ot ecnahc ruoy si siht ,resiuO :eerialC !hguone ,eerialC .sM ]enot deracs a ni[ :ellennA !reh tiH "!XUAERDUOB RESIUO DEPPALS I" 'niyas strihs-t lles ll'eW :eerialC ?dnim ruoy tsol uoy evah ,eerialC ]enot denethgirf a ni[ :yvurT ?eerialC ,*hgih* uoy erA :xuaerduoB resiuO !reh tiH :eerialC ?yzarc uoy erA ]desufnoc dna kcaba nekat[ :xuaerduoB resiuO !reh pals ,nnyL'M daeha oG !siht tiH :eerialC ]nnyL'M fo tnorf ni reh snoitisop dna redluohs eht yb resiuO sbarg[ !ereH :eerialC ]gnibbos seunitnoc[ !drah ti tih annaw I !gnihtemos tih annaw tsuj I !od I sa dab sa leef yeht lit' ydobemos *tih* annaw tsuj I-I !siht ekat nac I kniht t'nod I-I !siht ekat nac I kniht t'nod I-I !tsrif og ot ydaer neeb syawla ev'I .tsrif og ot desoppus m'I !yaw siht neppah ot desoppus ton s'tI !oN !oN !oN :nnyL'M ]enot mrif a ni[ !dnatsrednu dluoc I hsiw I ,droL ?*yhW* ?*yhw* wonk annaw I *doG* hO !mih rof hguorht tnew ehs tahw wonk *reve* eh lliW !saw rehtom sih lufrednow woh wonk *reve* lliw ybab taht woh wonk annaw I !revo si efil s'yblehS *yhw* wonk annaw I !yhw wonk annaw I !od ot tahw wonk t'nod I dam os ma I !doG hO !dluoc reven ehS !t'nac rethguad ym tub ,kcab dna saxeT ot yaw eht lla goj nac I !enif m'I :nnyL'M ]gnimaercs[ .enif m'I ,enif m'I ,enif m'I ]gniyrc[ :nnyL'M ?gnihtemos ro dlihc llams a revo nur uoy - yadot deneppah tahW .reppihc tsomla dnuos uoy ,resiuO :eerialC !em yb tis emoc ,ydobyna tuoba yas ot ecin gnihtyna evah t'nod uoy fi :yas yeht tahw wonk uoy ,lleW :rehcleB eerialC !sraey 04 doom dab yrev a ni neeb tsuj ev'I ,yzarc ton m'I :xuaerduoB resiuO
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
