Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

PLEASE HELP!!! Will rate! Classes in C++, very confused after spending hours Par

ID: 3804145 • Letter: P

Question

PLEASE HELP!!! Will rate! Classes in C++, very confused after spending hours

Part I Inthispartoftheassignm ent,youaretocreateaclass, SpellChecker.Youwilldefinesomeclass data members, member methods and helper functions. The class methods will be used to check and correct the spelling of words. Elements of this assignment are intentionally vague; at this point in the semester, you should be able to make your own decisions about appropriate data structures for storing and looking up data, as well as defining helper functions. You can assume that your code will never be storing more than 10,000 valid or misspelled words.

SpellChecker should have at least the following Public members:
string language: the name of the language this spell checker is using (i.e. “English”, “Spanish”,

...)

SpellCheck er should have at least the following Private members:

char begin_mark: used for marking the beginning of an unknown word in a string

char end_mark: used for marking the end of an unknown word.

SpellChecker should have three constructors (set the object’s data members to some default values) :

Default Constructor, the one with no parameters.

Secondconstru ctorthattakesastringparameterfortheobject's language.

Third constructor that takes a string for the object's language and two filenames as

parameters. The first filename specifies the file with correctly spelled words and the second filename specifies the misspelled words with their corrections.

You will be dealing with two different file types:

The data in the first filename supplies a list of correctly spelled words, one word per line:

The data in the second filename contains a list of misspelled words and their correct spellings. The word and its correction are separated by a tab character (‘ ’):

It is very important you understand the format of this file. The correctly spelled words may have spaces in them! For example a file that converts common texting abbreviations into words:

The constructor with the filename parameters should open the files and read them into the appropriate data members of the class. To find if a word is a valid spelling or is a misspelling, you should think about storing the words in the right structure so that it’s easy to search and access it.

SpellChecker should also include the following public methods:

bool loadValidWords(string filename) : this method should read in a file in exactly the same way as detailed in the description of the constructor. The file will have the format specifiedforcorrectlyspelledwords.Thismethodshouldreturna booleanofwhetherornot thefilewassuccessfullyreadin. Thismethodshouldaddthewordsfromthefiletothelistof words already contained in the object.

bool loadMisspelledWords(string filename) : this method should read in a file in exactly thesamewayasdetailedinthedescriptionoftheconstructor. Thefilewillhavetheformat specified for the wrongly spelled words and their corrected spellings. This method should returna booleanofwhetherornotthefilewassuccessfullyreadin. Thismethodshouldadd the words from the file to the list of words already contained in the object.

Setters and Getters for the markers to be used for unknown words (see description of marker use below).

void setBeginMarker(char begin)

void setEndMarker(char end)

char getBeginMarker()

char getEndMarker()

string fixUp(string sentence) : Fixup will take in a string of multiple words, break it into individual words, strip out all the punctuation, and ignoring the case, return the sentence with all misspellings corrected and unknown words marked (see below). For example: here are what the following calls would return:

Testing
Testing of your class and all of its methods is now in your hands. You must determine the test cases thatwilltestifyourimplementationreturnsthecorrectresultsinallconditions. Forexample,you would need to write code that will declare SpellChecker objects with each of the possible constructors and verify that each of those methods will create and initialize the object correctly. The same must be done for each of the other public methods to verify that your implementation works correctly in all possible conditions and ordering of calls to those methods.

Once you are satisfied that your code works as intended, submit it to COG for its evaluation.

MISSPELLED.TXT File:

abilitey   ability
abouy   about
absorbtion   absorption
accidently   accidentally
accomodate   accommodate
acommadate   accommodate
acord   accord
aquantance   acquaintance
equire   acquire
adultry   adultery
aggresive   aggressive
alchohol   alcohol
alchoholic   alcoholic
allieve   alive
alright   all_right
amature   amateur
ambivilant   ambivalent
amourfous   amorphous
amification   amplification
anonomy   anatomy
anotomy   anatomy
annuncio   announce
annonsment   announcement
annoint   anoint
anynomous   anonymous
appresteate   appreciate
appreceiated   appreciated
archeype   archetype
aratictature   architecture
aricticure   architecture
artic   arctic
asterick   asterisk
asymetric   asymmetric
asentote   asymptote
ast   at
atentively   attentively
autoamlly   automatically
bankrot   bankrupt
basicly   basically
batallion   battalion
beggining   beginning
beging   beginning
bigginging   beginning
behaviour   behavior
behavior   behaviour
beleive   believe
belive   believe
benidifs   benefits
metter   better
blait   bleat
boygot   boycott
brocolli   broccoli
bbrose   browse
bouyant   buoyant
beauro   bureau
beaurocracy   bureaucracy
buracracy   bureaucracy
burracracy   bureaucracy
buch   bush
buder   butter
budr   butter
budter   butter
buton   button
byby   by_by
cauler   caller
gamne   came
cravets   caveats
cemetary   cemetery
changeing   changing
cheet   cheat
cicle   circle
circue   circle
circumstaces   circumstances
clob   club
cocamena   cockamamie
colleaque   colleague
colloquilism   colloquialism
coaln   colon
columne   column
cumba   combo
commerciasl   commercials
comitmment   commitment
comittmen   commitment
comittmend   commitment
commited   committed
comitte   committee
commitee   committee
companys   companies
comiler   compiler
compicated   complicated
comupter   computer
congradulations   congratulations
concensus   consensus
consident   consistent
consident   consonant
contast   constant
contastant   constant
contunie   continue
conibation   contribution
cooly   coolly
copping   coping
cosmoplyton   cosmopolitan
courst   court
crasy   crazy
credetability   credibility
criqitue   critique
ctitique   critique
croke   croak
crusifed   crucified
crucifiction   crucifixion
custamisation   customization
daly   daily
danguages   dangerous
dongle   dangle
disition   decision
defense   defence
defence   defense
defenly   defiantly
definate   definite
definately   definitely
dieties   deities
dependeble   dependable
descrption   description
descrptn   description
dessicate   desiccate
dispair   despair
desparate   desperate
distroy   destroy
developement   development
develpond   development
develepment   developments
ductioneery   dictionary
dinasaur   dinosaur
dinasour   dinosaur
direcyly   directly
diagree   disagree
discuess   discuss
disssicion   discussion
disect   dissect
disippate   dissipate
destint   distant
distart   distort
distarct   distract
devulge   divulge
documtations   documentation
dag   dog
doog   dog
doenload   download
deaft   draft
dramaticly   dramatically
drunkeness   drunkenness
dur   due
duren   during
dymatic   dynamic
dynaic   dynamic
ecstacy   ecstasy
efficity   efficacy
efficat   efficient
effots   efforts
elagent   elegant
elligit   elegant
embarass   embarrass
embaress   embarrass
embarassment   embarrassment
imbed   embed
encapsualtion   encapsulation
encyclapidia   encyclopedia
encyclopia   encyclopedia
engins   engine
enhence   enhance
enligtment   enlightenment
ennuui   ennui
enought   enough
enviroment   environment
envireminakl   environmental
invermeantial   environmental
epitomy   epitome
errara   error
erro   error
expresso   espresso
eitiology   etiology
evaualtion   evaluation
evtually   eventually
evething   everything
excede   exceed
excpt   except
excution   execution
excercise   exercise
exhileration   exhilaration
egsistence   existence
existance   existence
exspidient   expedient
expleyly   explicitly
explity   explicitly
extions   extensions
factontion   factorization
failer   failure
phantasia   fantasia
famdasy   fantasy
faver   favor
faver   favour
faxe   fax
fistival   festival
firey   fiery
flatterring   flattering
fluk   flux
flukse   flux
forsee   foresee
frustartaion   frustrating
fuction   function
generly   generally
gotton   gotten
goberment   government
gobernement   government
gobernment   government
gracefull   graceful
gradualy   gradually
grammer   grammar
gaurd   guard
futs   guts
hapily   happily
harrass   harass
havne   have
heighth   height
hallo   hello
helo   hello
herlo   hello
heellp   help
hellp   help
hlp   help
higer   higher
hippopotamous   hippopotamus
hourse   horse
houssing   housing
howaver   however
howver   however
humaniti   humanity
hifin   hyphen
hifine   hyphen
hiphine   hyphen
hyfin   hyphen
hypotathes   hypothesis
hypotathese   hypothesis
hystrical   hysterical
illegitament   illegitimate
immenant   immanent
imediaetly   immediately
implemtes   implements
incase   in_case
indepth   in_depth
infact   in_fact
inadvertant   inadvertent
incompleet   incomplete
incomplot   incomplete
inconvience   inconvenience
inconvenant   inconvenient
ident   indent
independant   independent
independenent   independent
indepnends   independent
indispensible   indispensable
inefficite   inefficient
imfamy   infamy
influencial   influential
inital   initial
initinized   initialized
initized   initialized
innoculate   inoculate
incedious   insidious
insistant   insistent
insistenet   insistent
instulation   installation
intealignt   intelligent
intejilent   intelligent
intelegent   intelligent
intelegnent   intelligent
intelejent   intelligent
inteligent   intelligent
intelignt   intelligent
intellagant   intelligent
intellegent   intelligent
intellegint   intelligent
intellgnt   intelligent
intertes   interested
intertesd   interested
inerface   interface
internation   international
interpretate   interpret
interpretter   interpreter
enventions   inventions
irresistable   irresistible
irritible   irritable
isotrop   isotope
interate   iterate
johhn   john
judgment   judgement
judgement   judgment
lilometer   kilometer
lilometer   kilometre
kippur   kipper
knawing   knowing
luser   laser
latext   latest
lloyer   layer
leasve   leave
lesure   leisure
liasion   lesion
liason   liaison
libary   library
likly   likely
liquify   liquefy
lossing   losing
maddness   madness
maintanence   maintenance
majaerly   majority
majoraly   majority
marshall   marshal
maks   masks
maxium   maximum
midia   media
momento   memento
meory   memory
pataphysical   metaphysical
mic   mike
millenium   millennium
minum   minimum
miniscule   minuscule
misilous   miscellaneous
mischievious   mischievous
minkay   monkey
monkay   monkey
mroe   more
mosaik   mosaic
mostlikely   most_likely
mousr   mouser
oving   moving
nieve   naive
neccessary   necessary
necesary   necessary
necesser   necessary
neighbour   neighbor
neighbor   neighbour
nickleodeon   nickelodeon
neice   niece
noone   no_one
notin   not_in
noticably   noticeably
nozled   nuzzled
obsfuscate   obfuscate
objectsion   objects
ocassion   occasion
accosinly   occasionally
occusionaly   occasionally
occuppied   occupied
occurence   occurrence
octagenarian   octogenarian
olf   old
opposim   opossum
organise   organize
organiz   organize
orientate   orient
oscilascope   oscilloscope
parametic   parameter
paramers   parameters
paranets   parameters
partrucal   particular
patten   pattern
preemptory   peremptory
permissable   permissible
permition   permission
permmasivie   permissive
phenominal   phenomenal
fone   phone
funetik   phonetic
picaresque   picturesque
playwrite   playwright
pollice   police
politict   politic
polation   politician
poligamy   polygamy
polypropalene   polypropylene
protray   portray
possable   possible
practicle   practical
pragmaticism   pragmatism
preceeding   preceding
precion   precision
precios   precision
prefixt   prefixed
prefices   prefixes
perogative   prerogative
privielage   privilege
priviledge   privilege
proplematic   problematic
proceedures   procedures
pronensiation   pronunciation
pronisation   pronunciation
pronounciation   pronunciation
properally   properly
pscolgst   psychologist
psicolagest   psychologist
psycolagest   psychologist
sicolagest   psychologist
persue   pursue
presue   pursue
presued   pursued
quoz   quiz
reccona   raccoon
radious   radius
ramplily   rampantly
wrank   rank
recieve   receive
reconise   recognize
reccomend   recommend
rectangeles   rectangle
reoccurring   recurring
redign   redesign
irregardless   regardless
repitition   repetition
replasments   replacement
reseblence   resemblance
respct   respect
respecally   respectfully
reposable   responsible
roon   room
rought   roughly
rudemtry   rudimentary
runnung   running
sacreligious   sacrilegious
saftly   safely
salut   salute
satifly   satisfy
scrabdle   scrabble
secion   section
segements   segments
sieze   seize
sence   sense
seperate   separate
seferal   several
sherbert   sherbet
singal   signal
cimplicity   simplicity
simpfilty   simplicity
simplye   simply
sitte   site
situration   situation
smil   smile
snuck   sneaked
sometmes   sometimes
soonec   sonic
specificialy   specifically
spel   spell
spoak   spoke
sponsered   sponsored
stering   steering
stumach   stomach
straightjacket   straitjacket
stutent   student
styleguide   style_guide
subpena   subpoena
subjecribed   subscribed
subisitions   substitutions
substations   substitutions
suger   sugar
superfulous   superfluous
supercede   supersede
swim_wear   swimwear
slyph   sylph
syncorization   synchronization
tattos   tattoos
tem   team
techniquely   technically
tesst   test
ttest   test
tets   tests
thanot   than_or
taht   that
teh   the
thw   the
theirselves   themselves
teridical   theoretical
theridically   theoretical
thredically   theoretically
ths   this
thruout   throughout
titalate   titillate
todayy   today
tommorrow   tomorrow
tomorow   tomorrow
taff   tough
tradegy   tragedy
trubbel   trouble
tunnellike   tunnel_like
tured   turned
teo   two
tork torque
tyrrany   tyranny
unconscience   unconscious
unconisitional   unconstitutional
unformanlly   unfortunately
unfortally   unfortunately
unfortunently   unfortunately
unentelegible   unintelligible
unatourral   unnatural
unaturral   unnatural
unnaturral   unnatural
upcast   up_cast
uranisium   uranium
upmost   utmost
verison   version
vinagarette   vinaigrette
volye   volley
volunteerism   voluntarism
volumptuous   voluptuous
waite   wait
mant   want
whard   ward
warloord   warlord
wadting   wasting
wicken   weaken
wierd   weird
whaaat   what
whimp   wimp
writting   writing
yeild   yield
youe   your

aardvark apple acquire

Explanation / Answer

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include<stdio.h>

int main()


temp=pr[i];
pr[i]=pr[pos];
pr[pos]=temp;

temp=bt[i];
bt[i]=bt[pos];
bt[pos]=temp;

temp=p[i];
p[i]=p[pos];
p[pos]=temp;
}

wt[0]=0; //waiting time for initial method is zero

//calculate waiting time
for(i=1;i<n;i++)
  

avg_wt=total/n; //average waiting time
total=0;

printf(" Process Burst Time Waiting Time Turnaround Time");
for(i=0;i<n;i++)
turnaround
total+=tat[i];
printf(" P[%d] %d %d %d",p[i],bt[i],wt[i],tat[i]);
}

avg_tat=total/n; //average turnaround
printf(" Average Waiting Time=%d",avg_wt);
printf(" Average Turnaround Time=%d ",avg_tat);

return 0;
}

C++ Program


#include<iostream>

using namespace std;

int main()
{
int bt[20],p[20],wt[20],tat[20],pr[20],i,j,n,total=0,pos,temp,avg_wt,avg_tat;
cout<<"Enter Total variety of Process:";
cin>>n;

cout<<" Enter Burst Time and Priority ";
for(i=0;i<n;i++)
{
cout<<" P["<<i+1<<"] ";
cout<<"Burst Time:";
cin>>bt[i];
cout<<"Priority:";
cin>>pr[i];
p[i]=i+1; //contains method variety
}

//sorting burst time, priority and method variety in ascending order mistreatment choice type
for(i=0;i<n;i++)
  

temp=pr[i];
pr[i]=pr[pos];
pr[pos]=temp;

temp=bt[i];
bt[i]=bt[pos];
bt[pos]=temp;

temp=p[i];
p[i]=p[pos];
p[pos]=temp;
}

wt[0]=0; //waiting time for initial method is zero

//calculate waiting time
for(i=1;i<n;i++)
  

avg_wt=total/n; //average waiting time
total=0;

cout<<" Process Burst Time Waiting Time Turnaround Time";
for(i=0;i<n;i++)
turnaround
total+=tat[i];
cout<<" P["<<p[i]<<"] "<<bt[i]<<" "<<wt[i]<<" "<<tat[i];
}

avg_tat=total/n; //average turnaround
cout<<" Average Waiting Time="<<avg_wt;
cout<<" Average Turnaround Time="<<avg_tat;

return 0;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include<iostream>

using namespace std;

int main()
{
int bt[20],p[20],wt[20],tat[20],pr[20],i,j,n,total=0,pos,temp,avg_wt,avg_tat;
cout<<"Enter Total variety of Process:";
cin>>n;

cout<<" Enter Burst Time and Priority ";
for(i=0;i<n;i++)
{
cout<<" P["<<i+1<<"] ";
cout<<"Burst Time:";
cin>>bt[i];
cout<<"Priority:";
cin>>pr[i];
p[i]=i+1; //contains method variety
}

//sorting burst time, priority and method variety in ascending order mistreatment choice type
for(i=0;i<n;i++)
  

temp=pr[i];
pr[i]=pr[pos];
pr[pos]=temp;

temp=bt[i];
bt[i]=bt[pos];
bt[pos]=temp;

temp=p[i];
p[i]=p[pos];
p[pos]=temp;
}

wt[0]=0; //waiting time for initial method is zero

//calculate waiting time
for(i=1;i<n;i++)
  

avg_wt=total/n; //average waiting time
total=0;

cout<<" Process Burst Time Waiting Time Turnaround Time";
for(i=0;i<n;i++)
turnaround
total+=tat[i];
cout<<" P["<<p[i]<<"] "<<bt[i]<<" "<<wt[i]<<" "<<tat[i];
}

avg_tat=total/n; //average turnaround
cout<<" Average Waiting Time="<<avg_wt;
cout<<" Average Turnaround Time="<<avg_tat;

return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote