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 »
Need to create the program outlined in the handout. Included is the handout and the sample code to help. Thanks!


CITP 3310 Survey of Programming Languages Lab 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 break 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 Survey of Programming Languages Lab 9 Sample Output: Challenge Output: aa aah aahed aahing aahs aal aalii aaliis aals aardvark aardwolf aargh aarrgh aarrghh aas aasvogel ab aba abaca abacas abaci aback abacus abacuses abaft abaka abakas abalone abalones abamp abampere abamps abandon abandons abapical abas abase abased abasedly abaser abasers abases abash abashed abashes abashing abasia abasias abasing abatable abate abated abater abaters abates abating abatis abatises abator abators abattis abattoir abaxial abaxile abba abbacies abbacy abbas abbatial abbe abbes abbess abbesses abbey abbeys abbot abbotcy abbots abdicate abdomen abdomens abdomina abduce abduced abducens abducent abduces abducing abduct abducted abductor abducts abeam abed abele abeles abelia abelian abelias abelmosk aberrant abet abetment abets abettal abettals abetted abetter abetters abetting abettor abettors abeyance abeyancy abeyant abfarad abfarads abhenry abhenrys abhor abhorred abhorrer abhors abidance abide abided abider abiders abides abiding abigail abigails ability abioses abiosis abiotic abject abjectly abjure abjured abjurer abjurers abjures abjuring ablate ablated ablates ablating ablation ablative ablaut ablauts ablaze able ablegate abler 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 aborter aborters aborting abortion abortive aborts abos abought aboulia aboulias aboulic abound abounded abounds about above aboves abrachia abradant abrade abraded abrader abraders abrades abrading abrasion abrasive abreact abreacts abreast abri abridge abridged abridger abridges abris abroach abroad abrogate abrosia abrosias abrupt abrupter abruptly abs abscess abscise abscised abscises abscisin abscissa abscond absconds abseil abseiled abseils absence absences absent absented absentee absenter absently absents absinth absinthe absinths absolute absolve absolved absolver absolves absonant absorb absorbed absorber absorbs abstain abstains absterge abstract abstrict abstruse absurd absurder absurdly absurds abubble abulia abulias abulic abundant abusable abuse abused abuser abusers abuses abusing abusive abut abutilon abutment abuts abuttal abuttals abutted abutter 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 acceder acceders accedes acceding accent accented accentor accents accept accepted acceptee accepter acceptor accepts access accessed accesses accident accidia accidias accidie accidies acclaim acclaims accolade accord accorded accorder accords accost accosted accosts account accounts accouter accoutre accredit accrete accreted accretes accrual accruals accrue accrued accrues accruing accuracy accurate accursed accurst accusal accusals accusant accuse accused accuser accusers accuses accusing accustom ace aced acedia acedias aceldama acentric acequia acequias acerate acerated acerb acerbate acerber acerbest acerbic acerbity 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 achier achiest achieve achieved achiever achieves achillea achiness aching achingly achiote achiotes acholia acholias achoo achromat achromic achy acicula aciculae acicular aciculas aciculum acid acidemia acidhead acidic acidify acidity acidly acidness acidoses acidosis acidotic acids aciduria acidy acierate aciform acinar 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 acquirer acquires acquit acquits acrasia acrasias acrasin acrasins acre acreage acreages acred acres acrid acrider 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 actor actorish actors actress actressy acts actual actually actuary actuate actuated actuates actuator acuate acuities acuity aculeate aculei aculeus acumen acumens acutance acute acutely acuter acutes acutest acyclic acyl acylate acylated acylates acyloin acyloins acyls ad adage adages adagial adagio adagios adamance adamancy adamant adamants adamsite adapt adapted adapter adapters adapting adaption adaptive adaptor adaptors adapts adaxial add addable addax addaxes added addedly addend addenda addends addendum adder adders addible addict addicted addicts adding addition additive additory addle addled addles addling address addrest adds adduce adduced adducent adducer adducers adduces adducing adduct adducted adductor adducts adeem adeemed adeeming adeems adenine adenines adenitis adenoid adenoids adenoma adenomas adenoses adenosis adenyl adenyls adept adepter adeptest adeptly adepts adequacy adequate adhere adhered adherend adherent adherer 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 adjurer adjurers adjures adjuring adjuror adjurors adjust adjusted adjuster adjustor adjusts adjutant adjuvant adman admass admen admiral admirals admire admired admirer admirers admires admiring admit admits admitted admitter admix admixed admixes admixing admixt admonish adnate adnation adnexa adnexal adnoun adnouns ado adobe adobes adobo adobos adonis adonises adopt adopted adoptee adoptees adopter adopters adopting adoption adoptive adopts adorable adorably adore adored adorer adorers adores adoring adorn adorned adorner adorners adorning adorns ados adown adoze adrenal adrenals adrift adroit adroiter adroitly ads adscript adsorb adsorbed adsorber adsorbs adularia adulate adulated adulates adulator adult adultery adultly adults adumbral adunc aduncate aduncous adust advance advanced advancer advances advect advected advects advent advents adverb adverbs adverse advert adverted adverts advice advices advise advised advisee advisees adviser advisers advises advising advisor 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 aerator aerators aerial aerially aerials aerie aeried aerier 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 aether aetheric aethers afar afars afeard afeared afebrile aff affable affably affair affaire affaires affairs affect affected affecter affects afferent affiance affiant affiants affiche affiches affinal affine affined affinely affines affinity affirm affirmed affirmer affirms affix affixal affixed affixer affixers affixes affixial affixing afflatus afflict afflicts affluent afflux affluxes afford afforded affords afforest affray affrayed affrayer affrays affright affront affronts affusion afghan afghani afghanis afghans afield afire aflame afloat aflutter afoot afore afoul afraid afreet afreets afresh afrit afrits aft after afters aftertax aftmost aftosa aftosas ag aga again against agalloch agalwood agama agamas agamete agametes agamic agamous agapae agapai agape agapeic agar 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 ager ageratum agers ages aggadic agger aggers aggie aggies aggrade aggraded aggrades aggress aggrieve aggro aggros agha aghas aghast agile agilely agility agin aging agings aginner aginners agio agios agiotage agism agisms agist agisted agisting agists agitable agitate agitated agitates agitato agitator agitprop aglare agleam aglee aglet aglets agley aglimmer aglitter 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 DayJul 04, 2021

Answer To: CITP 3310 XXXXXXXXXXSurvey of Programming Languages XXXXXXXXXXLab 9 Lab 9 – More while Loops In this...

Neha answered on Jul 05 2021
143 Votes
61455 - C#/Challenge.cs
using System.IO;
class LinearSearch {
static void Challenge() {
st
ring 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;
break;
}
} while ((result = inFile.ReadLine()) != null);
if(found)
{
System.Console.WriteLine("That is real word!");
}
else
{
System.Console.WriteLine("Oh that isnt a real word!");
}
return;
}
}
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