Alpha Geek

(8)

$10/per page/Negotiable

About Alpha Geek

Levels Tought:
University

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Environmental science,Essay writing,Programming,Social Science,Statistics Hide all
Teaching Since: Apr 2017
Last Sign in: 346 Weeks Ago
Questions Answered: 9562
Tutorials Posted: 9559

Education

  • bachelor in business administration
    Polytechnic State University Sanluis
    Jan-2006 - Nov-2010

  • CPA
    Polytechnic State University
    Jan-2012 - Nov-2016

Experience

  • Professor
    Harvard Square Academy (HS2)
    Mar-2012 - Present

Category > Programming Posted 25 Jul 2017 My Price 5.00

Write a program that uses a while loop to read words from standard input (cin) into a string

Write a program that uses a while loop to read words from standard input (cin) into a string. This is an “infinite” while loop, which you break out of (and exit the program) using a break statement. For each word that is read, evaluate it by first using a sequence of if statements to “map” an integral value to the word, and then use a switch statement that uses that integral value as its selector (this sequence of events is not meant to be good programming style; it’s just supposed to give you exercise with control flow). Inside each case, print something meaningful. You must decide what the “interesting” words are and what the meaning is. You must also decide what word will signal the end of the program. Test the program by redirecting a file into the program’s standard input (if you want to save typing, this file can be your program’s source file).

 

 

 

Answers

(8)
Status NEW Posted 25 Jul 2017 11:07 AM My Price 5.00

-----------

Attachments

file 1500983496-Answer.docx preview (90 words )
p-----------ack-----------age----------- ja-----------vaP-----------rac-----------; i-----------mpo-----------rt -----------jav-----------a.i-----------o.B-----------uff-----------ere-----------dRe-----------ade-----------r; -----------imp-----------ort----------- ja-----------va.-----------io.-----------Fil-----------eRe-----------ade-----------r; -----------imp-----------ort----------- ja-----------va.-----------io.-----------IOE-----------xce-----------pti-----------on;----------- pu-----------bli-----------c c-----------las-----------s F-----------ile-----------Rea-----------d {----------- pr-----------iva-----------te -----------sta-----------tic----------- fi-----------nal----------- St-----------rin-----------g F-----------ILE-----------NAM-----------E =----------- &q-----------uot-----------;D:-----------\\I-----------npu-----------t.t-----------xt&-----------quo-----------t;;----------- pu-----------bli-----------c s-----------tat-----------ic -----------voi-----------d m-----------ain-----------(St-----------rin-----------g[]----------- ar-----------gs)----------- { -----------Buf-----------fer-----------edR-----------ead-----------er -----------br -----------= n-----------ull-----------; F-----------ile-----------Rea-----------der----------- fr----------- = -----------nul-----------l; -----------try----------- { -----------fr -----------= n-----------ew -----------Fil-----------eRe-----------ade-----------r(F-----------ILE-----------NAM-----------E);----------- br----------- = -----------new----------- Bu-----------ffe-----------red-----------Rea-----------der-----------(fr-----------); -----------Str-----------ing----------- sC-----------urr-----------ent-----------Lin-----------e; -----------br -----------= n-----------ew -----------Buf-----------fer-----------edR-----------ead-----------er(-----------new----------- Fi-----------leR-----------ead-----------er(-----------FIL-----------ENA-----------ME)-----------); -----------whi-----------le -----------((s-----------Cur-----------ren-----------tLi-----------ne
Not Rated(0)