Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

CITP 3310 XXXXXXXXXXSurvey of Programming Languages XXXXXXXXXXLab 9 Lab 9 – More while Loops In this lab, you will get more practice using while Loops. Example Program: EOF-controlled while loops are...

1 answer below »
CITP 3310 XXXXXXXXXXSurvey of Programming Languages XXXXXXXXXXLab 9
Lab 9 – More while Loops
In this lab, you will get more practice using while Loops.
Example Program:
EOF-controlled while loops are a special case of flag-controlled while loops. When we are reading from a
file and the end of the file is reached, a special case flag is set to true. For StreamReader, this is
EndOfStream.
The example program for EOF-controlled while loops reads a series of numbers from an input file and
finds the average of those numbers. Download EOF_Average.cs and create a project for it in Visual C#.
Read and understand the code and run the program.
Your Program
For your program you will search a dictionary file for the word provided by the user. First ask the user to
input a word. Search the dictionary file for that word and tell the user whether or not the word was
found.
This program demonstrates a linear search technique. When you perform a linear search, you start at
the beginning of a list and search through the list in order until you reach the desired item or the end of
the list. You may need to make use of a
eak statement to exit the loop early if you find a match. Linear
search is a very inefficient method, and we will learn about better search techniques later.
Here is a dictionary file for Windows that you can use. You must either put your dictionary file in your
Visual C# project folder, or specify the path to the dictionary file in your program. Your output should
look similar to the following figure. Turn in your completed program.
Challenge:
For the challenge component this week, modify your program through the use of the toLower() string
function so that capital or lowercase spelling by the user doesn’t affect the program. “Hello” or “hello”
should both return a positive answer (in the normal program, “Hello” will not, because the capital ‘H’
won’t match).
Additionally, rewrite the program to make use of a do…while loop, instead of a while loop. Submit both
forms (while for the basic lab, and do…while for the challenge).
CITP 3310 XXXXXXXXXXSurvey of Programming Languages XXXXXXXXXXLab 9
Sample Output:
Challenge Output:

aa
aah
aahed
aahing
aahs
aal
aalii
aaliis
aals
aardvark
aardwolf
aargh
aa
gh
aa
ghh
aas
aasvogel
a
aba
abaca
abacas
abaci
aback
abacus
abacuses
abaft
abaka
abakas
abalone
abalones
abamp
abampere
abamps
abandon
abandons
abapical
abas
abase
abased
abasedly
abase
abasers
abases
abash
abashed
abashes
abashing
abasia
abasias
abasing
abatable
abate
abated
abate
abaters
abates
abating
abatis
abatises
abato
abators
abattis
abattoi
abaxial
abaxile
a
a
a
acies
a
acy
a
as
a
atial
a
e
a
es
a
ess
a
esses
a
ey
a
eys
a
ot
a
otcy
a
ots
abdicate
abdomen
abdomens
abdomina
abduce
abduced
abducens
abducent
abduces
abducing
abduct
abducted
abducto
abducts
abeam
abed
abele
abeles
abelia
abelian
abelias
abelmosk
abe
ant
abet
abetment
abets
abettal
abettals
abetted
abette
abetters
abetting
abetto
abettors
abeyance
abeyancy
abeyant
abfarad
abfarads
abhenry
abhenrys
abho
abho
ed
abho
e
abhors
abidance
abide
abided
abide
abiders
abides
abiding
abigail
abigails
ability
abioses
abiosis
abiotic
abject
abjectly
abjure
abjured
abjure
abjurers
abjures
abjuring
ablate
ablated
ablates
ablating
ablation
ablative
ablaut
ablauts
ablaze
able
ablegate
able
ables
ablest
ablings
ablins
abloom
abluent
abluents
ablush
abluted
ablution
ably
abmho
abmhos
abnegate
abnormal
abo
aboard
abode
aboded
abodes
aboding
abohm
abohms
aboideau
aboil
aboiteau
abolish
abolla
abollae
aboma
abomas
abomasa
abomasal
abomasi
abomasum
abomasus
aboon
aboral
aborally
aborning
abort
aborted
aborte
aborters
aborting
abortion
abortive
aborts
abos
abought
aboulia
aboulias
aboulic
abound
abounded
abounds
about
above
aboves
a
achia
a
adant
a
ade
a
aded
a
ade
a
aders
a
ades
a
ading
a
asion
a
asive
a
eact
a
eacts
a
east
a
i
a
idge
a
idged
a
idge
a
idges
a
is
a
oach
a
oad
a
ogate
a
osia
a
osias
a
upt
a
upte
a
uptly
abs
abscess
abscise
abscised
abscises
abscisin
abscissa
abscond
absconds
abseil
abseiled
abseils
absence
absences
absent
absented
absentee
absente
absently
absents
absinth
absinthe
absinths
absolute
absolve
absolved
absolve
absolves
absonant
abso
abso
ed
abso
e
abso
s
abstain
abstains
absterge
abstract
abstrict
abstruse
absurd
absurde
absurdly
absurds
abu
le
abulia
abulias
abulic
abundant
abusable
abuse
abused
abuse
abusers
abuses
abusing
abusive
abut
abutilon
abutment
abuts
abuttal
abuttals
abutted
abutte
abutters
abutting
abuzz
abvolt
abvolts
abwatt
abwatts
aby
abye
abyes
abying
abys
abysm
abysmal
abysms
abyss
abyssal
abysses
acacia
acacias
academe
academes
academia
academic
academy
acajou
acajous
acaleph
acalephe
acalephs
acanthi
acanthus
acapnia
acapnias
acari
acarid
acaridan
acarids
acarine
acarines
acaroid
acarpous
acarus
acaudal
acaudate
acauline
acaulose
acaulous
accede
acceded
accede
acceders
accedes
acceding
accent
accented
accento
accents
accept
accepted
acceptee
accepte
accepto
accepts
access
accessed
accesses
accident
accidia
accidias
accidie
accidies
acclaim
acclaims
accolade
accord
accorded
accorde
accords
accost
accosted
accosts
account
accounts
accoute
accoutre
accredit
accrete
accreted
accretes
accrual
accruals
accrue
accrued
accrues
accruing
accuracy
accurate
accursed
accurst
accusal
accusals
accusant
accuse
accused
accuse
accusers
accuses
accusing
accustom
ace
aced
acedia
acedias
aceldama
acentric
acequia
acequias
acerate
acerated
ace
ace
ate
ace
e
ace
est
ace
ic
ace
ity
acerola
acerolas
acerose
acerous
acervate
acervuli
aces
acescent
aceta
acetal
acetals
acetamid
acetate
acetated
acetates
acetic
acetify
acetin
acetins
acetone
acetones
acetonic
acetose
acetous
acetoxyl
acetum
acetyl
acetylic
acetyls
ache
ached
achene
achenes
achenial
aches
achie
achiest
achieve
achieved
achieve
achieves
achillea
achiness
aching
achingly
achiote
achiotes
acholia
acholias
achoo
achromat
achromic
achy
acicula
aciculae
acicula
aciculas
aciculum
acid
acidemia
acidhead
acidic
acidify
acidity
acidly
acidness
acidoses
acidosis
acidotic
acids
aciduria
acidy
acierate
aciform
acina
acing
acini
acinic
acinose
acinous
acinus
ackee
ackees
aclinic
acmatic
acme
acmes
acmic
acne
acned
acnes
acnode
acnodes
acock
acold
acolyte
acolytes
aconite
aconites
aconitic
aconitum
acorn
acorns
acoustic
acquaint
acquest
acquests
acquire
acquired
acquire
acquires
acquit
acquits
acrasia
acrasias
acrasin
acrasins
acre
acreage
acreages
acred
acres
acrid
acride
acridest
acridine
acridity
acridly
acrimony
acrobat
acrobats
acrodont
acrogen
acrogens
acrolect
acrolein
acrolith
acromia
acromial
acromion
acronic
acronym
acronyms
acrosome
across
acrostic
acrotic
acrotism
acrylate
acrylic
acrylics
act
acta
actable
acted
actin
actinal
acting
actings
actinia
actiniae
actinian
actinias
actinic
actinide
actinism
actinium
actinoid
actinon
actinons
actins
action
actions
activate
active
actively
actives
activism
activist
activity
activize
acto
actorish
actors
actress
actressy
acts
actual
actually
actuary
actuate
actuated
actuates
actuato
acuate
acuities
acuity
aculeate
aculei
aculeus
acumen
acumens
acutance
acute
acutely
acute
acutes
acutest
acyclic
acyl
acylate
acylated
acylates
acyloin
acyloins
acyls
ad
adage
adages
adagial
adagio
adagios
adamance
adamancy
adamant
adamants
adamsite
adapt
adapted
adapte
adapters
adapting
adaption
adaptive
adapto
adaptors
adapts
adaxial
add
addable
addax
addaxes
added
addedly
addend
addenda
addends
addendum
adde
adders
addible
addict
addicted
addicts
adding
addition
additive
additory
addle
addled
addles
addling
address
addrest
adds
adduce
adduced
adducent
adduce
adducers
adduces
adducing
adduct
adducted
adducto
adducts
adeem
adeemed
adeeming
adeems
adenine
adenines
adenitis
adenoid
adenoids
adenoma
adenomas
adenoses
adenosis
adenyl
adenyls
adept
adepte
adeptest
adeptly
adepts
adequacy
adequate
adhere
adhered
adherend
adherent
adhere
adherers
adheres
adhering
adhesion
adhesive
adhibit
adhibits
adieu
adieus
adieux
adios
adipic
adipose
adiposes
adiposis
adipous
adit
adits
adjacent
adjoin
adjoined
adjoins
adjoint
adjoints
adjourn
adjourns
adjudge
adjudged
adjudges
adjunct
adjuncts
adjure
adjured
adjure
adjurers
adjures
adjuring
adjuro
adjurors
adjust
adjusted
adjuste
adjusto
adjusts
adjutant
adjuvant
adman
admass
admen
admiral
admirals
admire
admired
admire
admirers
admires
admiring
admit
admits
admitted
admitte
admix
admixed
admixes
admixing
admixt
admonish
adnate
adnation
adnexa
adnexal
adnoun
adnouns
ado
adobe
adobes
adobo
adobos
adonis
adonises
adopt
adopted
adoptee
adoptees
adopte
adopters
adopting
adoption
adoptive
adopts
adorable
adorably
adore
adored
adore
adorers
adores
adoring
adorn
adorned
adorne
adorners
adorning
adorns
ados
adown
adoze
adrenal
adrenals
adrift
adroit
adroite
adroitly
ads
adscript
adso
adso
ed
adso
e
adso
s
adularia
adulate
adulated
adulates
adulato
adult
adultery
adultly
adults
adum
al
adunc
aduncate
aduncous
adust
advance
advanced
advance
advances
advect
advected
advects
advent
advents
adve
adve
s
adverse
advert
adverted
adverts
advice
advices
advise
advised
advisee
advisees
advise
advisers
advises
advising
adviso
advisors
advisory
advocacy
advocate
advowson
adynamia
adynamic
adyta
adytum
adz
adze
adzes
adzuki
adzukis
ae
aecia
aecial
aecidia
aecidial
aecidium
aecium
aedes
aedile
aediles
aedine
aegis
aegises
aeneous
aeneus
aeolian
aeon
aeonian
aeonic
aeons
aequorin
aerate
aerated
aerates
aerating
aeration
aerato
aerators
aerial
aerially
aerials
aerie
aeried
aerie
aeries
aeriest
aerified
aerifies
aeriform
aerify
aerily
aero
aerobe
aerobes
aerobia
aerobic
aerobics
aerobium
aeroduct
aerodyne
aerofoil
aerogel
aerogels
aerogram
aerolite
aerolith
aerology
aeronaut
aeronomy
aerosat
aerosats
aerosol
aerosols
aerostat
aerugo
aerugos
aery
aesthete
aestival
aethe
aetheric
aethers
afa
afars
afeard
afeared
afe
ile
aff
affable
affably
affai
affaire
affaires
affairs
affect
affected
affecte
affects
afferent
affiance
affiant
affiants
affiche
affiches
affinal
affine
affined
affinely
affines
affinity
affirm
affirmed
affirme
affirms
affix
affixal
affixed
affixe
affixers
affixes
affixial
affixing
afflatus
afflict
afflicts
affluent
afflux
affluxes
afford
afforded
affords
afforest
affray
affrayed
affraye
affrays
affright
affront
affronts
affusion
afghan
afghani
afghanis
afghans
afield
afire
aflame
afloat
aflutte
afoot
afore
afoul
afraid
afreet
afreets
afresh
afrit
afrits
aft
afte
afters
aftertax
aftmost
aftosa
aftosas
ag
aga
again
against
agalloch
agalwood
agama
agamas
agamete
agametes
agamic
agamous
agapae
agapai
agape
agapeic
aga
agaric
agarics
agarose
agaroses
agars
agas
agate
agates
agatize
agatized
agatizes
agatoid
agave
agaves
agaze
age
aged
agedly
agedness
agee
ageing
ageings
ageism
ageisms
ageist
ageists
ageless
agelong
agencies
agency
agenda
agendas
agendum
agendums
agene
agenes
ageneses
agenesia
agenesis
agenetic
agenize
agenized
agenizes
agent
agential
agenting
agentive
agentry
agents
age
ageratum
agers
ages
aggadic
agge
aggers
aggie
aggies
aggrade
aggraded
aggrades
aggress
aggrieve
aggro
aggros
agha
aghas
aghast
agile
agilely
agility
agin
aging
agings
aginne
aginners
agio
agios
agiotage
agism
agisms
agist
agisted
agisting
agists
agitable
agitate
agitated
agitates
agitato
agitato
agitprop
aglare
agleam
aglee
aglet
aglets
agley
aglimme
aglitte
aglow
agly
aglycon
aglycone
aglycons
agma
agmas
agminate
agnail
agnails
agnate
agnates
agnatic
agnation
agnize
agnized
agnizes
agnizing
agnomen
agnomens
agnomina
agnosia
agnosias
agnostic
ago
agog
agon
agonal
agone
agones
agonic
agonies
agonise
agonised
agonises
agonist
agonists
agonize
agonized
Answered Same Day Jul 04, 2021

Solution

Neha answered on Jul 05 2021
130 Votes
61455 - C#/Challenge.cs
using System.IO;
class LinearSearch {
static void Challenge() {
string word;
string result = "";
string lowerword;
bool found = false;
StreamReader inFile = new StreamReader("dictionary.txt");
System.Console.WriteLine("Enter a word to search in dictionary: ");
word = System.Console.ReadLine();
lowerword = word.ToLower();
do
{
if (result.Contains(lowerword))
{
found = true;

eak;
}
} while ((result = inFile.ReadLine()) != null);
if(found)
{
System.Console.WriteLine("That is real word!");
}
else
{
System.Console.WriteLine("Oh that isnt a real word!");
}
eturn;
}
}
61455 -...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here