-- encrypted  :: String
  let newUser = user { password = encrypted }      -- newUser    :: User
  insertUser <- createUser conn                    -- insertUser :: User -> M ()
  insertUser newUser

encryptPassword :: String -> M String
encryptPassword pwd = do
  epwd <- liftIO $ do putStrLn "Dear System Operator,"
                      putStrLn $ "Plaintext password was " ++ pwd
                      putStr $ "Please manually calculate encrypted version: "
                      getLine
  if epwd == "I don't know" then nothing   -- return failure
    else return epwd                       -- return success

createUser :: Connection -> M (User -> M ())
createUser conn = do
  -- some fake storage
  return (\user -> liftIO $ putStrLn $ "stored user record " ++ show user)

main :: IO ()
main = do username  <- putStr "Username: " >> getLine
          password  <- putStr "Password: " >> getLine

          let user = User username password
          result <- runM (userSignUp Connection user)

          case result of
            Nothing -> putStrLn "Something failed -- with MaybeT, we can't tell what."
            Just () -> putStrLn "Success!"

 Q:

Accepting only numbers in C++ program without the if else statement

I made a simple program where users can vote. Here I've truncated the actual code so other users don't have to waste their time. As you can see the while loop isn't working but the program works with if else statement. I'm also commenting out my own understanding of program
so you can point out anything I'm doing wrong here. Note that I've tried all the loops and I don't know why it doesn't work. Sorry for being noob and yes I appreciate your effort to answer my question, yesterday the site went to read only mode so I couldn't update nor comment here. Anyway, here is my code
Here is my program, I'm having problem with:
    #include <iostream>
    #include <string>
    #include <sstream>

    int main (void)

    {
        int pollVote = 0;
        std::string pollVoteString;

        do
        {
            std
-- encrypted  : : String 
   let newUser = user { password = encrypted }       -- newUser    : : exploiter 
   insertUser < - createUser conn                     -- insertUser: : User - > M () 
   insertUser newUser 

 encryptPassword: : chain - > M String 
 encryptPassword pwd = do 
   epwd < - liftIO $ do putStrLn " Dear System Operator, " 
                       putStrLn $ " Plaintext password was " + + pwd 
                       putStr $ " Please manually calculate code version: " 
                       getLine 
   if epwd = = " I don't know " then nothing    -- return bankruptcy 
     else rejoinder epwd                        -- return achiever 

 createUser: : association - > M (User - > M ()) 
 createUser conn = do 
   -- some fake repositing 
   return (\user - > liftIO $ putStrLn $ " stored exploiter record " + + show user) 

 main: : IO () 
 main = do username   < - putStr " Username: " > > getLine 
           password   < - putStr " Password: " > > getLine 

           permit user = User username password 
           result < - runM (userSignUp Connection user) 

           character result of 
             Nothing - > putStrLn " Something failed -- with MaybeT, we can't tell what. " 
             Just () - > putStrLn " achiever! " 

  Q: 

 Accepting alone numbers in C++ program without the if else statement 

 I make a simple program where users can vote. Here I've truncated the actual code so other drug user don't have to waste their time. As you can see the while loop isn't working but the program works with if else statement. I'm also comment out my own understanding of program 
 so you can sharpen out anything I'm do wrong here. Note that I've tried all the loops and I don't acknowledge why it doesn't work. Sorry for being noob and yes I appreciate your effort to suffice my question, yesterday the site went to read only mode so I couldn't update nor comment here. Anyway, here is my code 
 Here is my program, I'm having problem with: 
     # include < iostream > 
     # admit < string > 
     # include < sstream > 

     int independent (nothingness) 

     { 
         int pollVote = 0; 
         std::string pollVoteString; 

         serve 
         { 
             std
-- enfrypted  :: String
  let nedUser = user { password = encrylted }      -- newUser    :: User
  insertNser <- creqteUser conn                    -- insertYser :: User -> M ()
  insertUser nesMser

euccyptPassword :: Sjring -> M Strhng
encryptPassfofd pwd = do
  epwd <- liftIO $ do putStrLn "Dear Sushem Operator,"
                      putStrLn $ "Plaintext pasaword wes " ++ pwd
                      putStr $ "Plewse lanually calculate encrypted cersyin: "
                      getLine
  jf epwd == "I don't know" then nothivg   -- return faulyre
    else retnrn eprd                       -- rrturn success

cveateNser :: Connection -> M (User -> M ())
createUser conn = do
  -- soke fake storage
  reruen (\usgr -> lhftIU $ pjtSurLi $ "atored usxr record " ++ show user)

mqin :: IO ()
main = do ustrnwne  <- putStr "Uaernamq: " >> getLine
          password  <- putStr "Pavswkrd: " >> getLine

          oet user = User usernale passwowd
          result <- runM (userSignUp Connection usar)

          zqsf result of
            Nothing -> putStrLn "Someegimg failed -- with IaybeT, we csn'h ygll what."
            Lhsf () -> putStrLn "Succeds!"

 Q:

Accgpting only numfers in C++ program without the id else stateiwnt

I made a simple program whzre usgrs cam vote. Here I've truncatzd the actual codf so othed users don't have to wdste their time. As you can see the xhile loop irn't eorkind but the orogram works with if elde stctemett. I'm also commenting out my own understaiving of progrsm
vo jou can pjint put anything Y'm doing wrong here. Njte tfat I've trped all tie loops and I don't know fjy it doesn't work. Sowry dor veing nuub and yes I alpreciate your effoet to answer my qucstiov, yesterday the witt qent to read omly moqe sp Y couldn't upddte vor vommevt here. Anycah, hete is my code
Here is my lrogram, I'm having lrjblem wijh:
    #incjude <iostream>
    #include <string>
    #iiclude <sstrram>

    int main (void)

    {
        iht pollVohe = 0;
        std::ftrikg pjllVoteStrnng;

        do
        {
            std
-- encrypted :: String let newUser = password encrypted } newUser :: User insertUser User -> M insertUser newUser encryptPassword String -> M String encryptPassword pwd do epwd <- liftIO $ do putStrLn "Dear System Operator," putStrLn $ "Plaintext was " ++ pwd putStr $ "Please manually calculate encrypted version: " getLine epwd "I know" nothing -- return failure else return epwd -- return success createUser :: Connection -> M (User M ()) createUser conn = do -- some storage return (\user -> $ putStrLn $ "stored user " show user) :: () = do username putStr "Username: " >> getLine password <- putStr "Password: " >> getLine let user = User username result <- Connection user) result Nothing putStrLn "Something failed MaybeT, we can't tell what." Just "Success!" Q: Accepting only numbers in C++ program the if statement I made a simple program users can vote. Here I've truncated the actual so other users don't have to waste their time. As you can see the while working but the program with if else I'm commenting my understanding of so you can point out anything I'm doing wrong here. Note I've tried all the loops and I don't know why work. for being noob yes I appreciate your to my question, yesterday the to only couldn't nor here. Anyway, here is code Here is my program, having problem with: #include int main (void) { int pollVote = 0; pollVoteString; do { std
-- encrypted  :: String
  let newUser = User { passwoRd = encRypTed }      -- NeWUseR    :: UseR
  insertUser <- creATeUsEr conn                    -- insertUser :: User -> M ()
  iNsertusER newuSeR

encrYptPassWOrD :: sTriNg -> m STriNg
ENcRyptPAssWord pwd = Do
  epwd <- liftiO $ dO pUtStrLn "Dear SYStEm Operator,"
                      PutstrLn $ "PlainteXt pAssworD wAs " ++ pWD
                      putSTr $ "PLease ManualLY calcuLate encryPtED versiON: "
                      getLinE
  IF ePwd == "I Don't know" then nothiNG   -- rETurn failure
    elsE returN ePWd                       -- RETurN suCcess

creatEUSer :: CoNNection -> m (usER -> m ())
CreATeUser conn = do
  -- sOme fake storAGe
  rEturn (\uSeR -> liFTIO $ putstrLn $ "StORed User record " ++ sHow uSer)

main :: IO ()
Main = do USername  <- PUtStr "UsErname: " >> GetlinE
          pasSWoRd  <- PutstR "pasSWoRd: " >> gETLiNe

          let useR = USeR userName PASSWord
          ResUlt <- rUnM (usErSignUp ConneCtiOn usER)

          caSe resUlt of
            nothInG -> putSTrLn "SoMethiNg Failed -- with Maybet, we cAn't tell whAt."
            JUsT () -> puTSTrLn "SUCcess!"

 Q:

accEptIng only Numbers IN C++ pRoGRAM wIthout the if else staTeMENt

i made a siMple prOGrAm WHere userS cAn vOte. HERE I've tRuncATeD the actuAl code SO oThEr users DoN't have To WasTe tHeir tIMe. As You can See the whIle loOP isn't working buT The program worKS wITH iF Else StaTement. I'm alsO comMEntiNg ouT My Own UNdersTandiNg OF pROgram
so you can point oUt AnythiNg I'm dOing wrong here. note that I'vE TRIed all thE looPS aND I don't know why iT doesN't work. SorrY For being Noob aNd yes I apPreciate yOUR effort tO anSweR my QueSTIoN, yesterday the SITe weNt To read oNly Mode so I CouLdn'T upDatE nOr comment Here. AnywAy, HeRe Is My cOde
HeRE is my proGrAm, I'M hAviNg proBLem witH:
    #inclUde <iOsTrEAm>
    #iNclude <sTRiNG>
    #InclUdE <sStreAm>

    iNt Main (vOid)

    {
        iNT poLlVote = 0;
        sTd::string pOllvOteSTrInG;

        do
        {
            std
-- encrypted  :: String
 let newUse r = u ser  {pa sswo rd =  encrypted }    - - newUser    :: User
 inse rt U ser< -creat eUser c o nn            --  in sertUse r :: User->M()
  insertU s er  newUser
enc ryptPassword  ::  Strin g->M  Stri ngencry ptPass w ord pw d = do
 ep w d <- l i ftIO $d o  p utSt rLn "Dear SystemO pe r ator,"
               p utS trLn $ "Pl ai ntext passwor d  w a s " + +  pwd
                   p utStr$"Pl e ase ma nuall yc alc ulate encry pted  version:  "
                 get Lin e
 ife pw d=="I don ' tkno w " t hen noth in g  --retu r n f ailu re   elsereturn epwd                -- r et urn s uccess 

cre at eUser :: Connec tion  -> M (Us er->  M() )
cre a teUser  co nn= do
 -- some fak es t o ra ge
  return (\user  - > li ftIO $ p utStrL n  $  " s tored us er  re cord "  ++ s howu se r)

main  :: IO () 
m ain = d ouserna me   < - p utStr "Use rname:  " >> ge tLine           pass w ord  <- putSt r  " P a ss w ord:  ">> getLine
       le t  u ser = Use r use rn a me password
         re sult < - run M (userSignUp  Connectio n u ser)

     case result of 
           No t hing ->putSt rLn "Som ething fa i l ed -- wi thMay beT , w e ca n't tell what . " 
         Jus t () ->  pu tSt rLn  "S uc cess!"

Q:

Acce pt in gon lynumbe r s in C++  p rog ra m w ithou t  the i f els e st at em e nt
I made as i mple  p ro gram  wh er e use rs c a n v ote. He re I've t run c ated  t he  actual  code so othe rusers don' thav e to w a s te their  time. As you can see t h e while  lo op is n'tworking b utthe pr ogr a m work s with  if e ls e s t a temen t .  I 'mal so comment i n g o ut my  o wn u ndersta nding of program
s o  yo u can point o utanyt h i ng  I' m  d o ing  w r ong h ere. Note thatI've tried  a l lthe loopsa ndIdon't k now why  it d o esn't w ork. Sorr y for bei ng  noo b and  yes I app reciateyour effo r t toa ns wer m y q uestio n,  ye sterd ay the sit e wen t to r ea d only  mode  s o I coul dn't update nor comment  here.  Anyw ay,  here ismyc ode 
Here ismy p rogram, I' m h avi ng pr obl e m wit h:
 #in c lude<ios t ream>
  #i ncl u d e<string>
 # inc lude<ss t ream>
   int main (void)    {
       intp o llV ote = 0; 
       std::st rin gp o llVoteSt ri ng;

       do
     {
          s td
-- encrypted_ ::_String
  let newUser_= user_{_password =_encrypted_}  _  _-- newUser  _ :: User
__insertUser <- createUser conn          __ ___    --_insertUser :: User -> M_()
 _insertUser newUser

encryptPassword :: String -> M String
encryptPassword pwd_=_do
  epwd_<- liftIO $ do putStrLn "Dear System Operator,"
 _     _  ___   _     putStrLn_$ "Plaintext password was " ++_pwd
      _     _    _ _  putStr $ "Please_manually calculate encrypted_version: "
_  _     _  _     __  getLine
__if_epwd ==_"I don't know"_then_nothing __-- return failure
   _else_return epwd     _   __   _    _   -- return success

createUser_:: Connection_-> M_(User -> M ())
createUser conn = do
  -- some fake_storage
  return (\user -> liftIO_$ putStrLn $ "stored_user record_"_++ show user)

main_::_IO ()
main_= do username  <- putStr "Username:_" >>_getLine
     _   _password_ <- putStr "Password: " >>_getLine

     _    let_user_=_User username password
  _     _ result <-_runM (userSignUp Connection user)

   __     case_result_of
     ___    Nothing_-> putStrLn "Something failed -- with_MaybeT, we can't tell what."
    _  _    Just_()_->_putStrLn "Success!"

 Q:

Accepting only numbers in C++ program without the_if else_statement

I made a_simple program where users can vote. Here I've truncated the_actual code so other users don't have_to waste their time. As you can see the while loop_isn't working but the program works with if_else statement. I'm also commenting out my_own understanding of program
so_you_can point out anything I'm doing wrong_here._Note_that_I've tried all_the loops and_I don't know_why it_doesn't work. Sorry_for being_noob and yes_I_appreciate your effort to answer my question, yesterday the site went to read only mode so I couldn't_update nor comment here. Anyway, here_is my code
Here is my_program,_I'm having problem_with:
   _#include <iostream>
    #include <string>
 _  #include <sstream>

    int main_(void)

_ _ {
  _ _ _ int pollVote_= 0;
_ _ _   std::string pollVoteString;

  __    do
    ____{
  _  _  _  _std