Facebook Page
Twitter
RSS
+ Reply to Thread
Results 1 to 6 of 6
  1. MHB Journeyman

    Status
    Offline
    Join Date
    Jul 2014
    Posts
    805
    Thanks
    599 times
    Thanked
    698 times
    Awards
    Chat Box Champion (2014)
    #1
    Write a switch statement that checks origLetter. If 'a' or 'A', print "Alpha". If 'b' or 'B', print "Beta". For any other character, print "Unknown". Use fall-through as appropriate. End with newline.

    Sample program:



    Just do the <STUDENT CODE> part.



    i dont get it. do i do case or if?

  2. MHB Seeker
    MHB Global Moderator
    MHB Math Scholar
    I like Serena's Avatar
    Status
    Online
    Join Date
    Mar 2012
    Location
    Netherlands
    Posts
    5,876
    Thanks
    3,927 times
    Thanked
    11,138 times
    Thank/Post
    1.896
    Awards
    MHB Model Helper Award (2016)  

MHB Best Ideas (2016)  

MHB LaTeX Award (2016)  

MHB Calculus Award (2014)  

MHB Discrete Mathematics Award (Jul-Dec 2013)
    #2
    Quote Originally Posted by ineedhelpnow View Post
    Write a switch statement that checks origLetter. If 'a' or 'A', print "Alpha". If 'b' or 'B', print "Beta". For any other character, print "Unknown". Use fall-through as appropriate. End with newline.

    Sample program:



    Just do the <STUDENT CODE> part.



    i dont get it. do i do case or if?
    Do "switch".

    That is:


    Oh. And don't spell it like
    defualt
    . It will take you ages to figure that out.
    Especially since it is completely legal, syntactically, as a label.

  3. MHB Journeyman

    Status
    Offline
    Join Date
    Jul 2014
    Posts
    805
    Thanks
    599 times
    Thanked
    698 times
    Awards
    Chat Box Champion (2014)
    #3 Thread Author
    could you be a little more specific? i dont really understand how to do it since i have like lowercase and uppercase alpha and beta

  4. MHB Seeker
    MHB Global Moderator
    MHB Math Scholar
    I like Serena's Avatar
    Status
    Online
    Join Date
    Mar 2012
    Location
    Netherlands
    Posts
    5,876
    Thanks
    3,927 times
    Thanked
    11,138 times
    Thank/Post
    1.896
    Awards
    MHB Model Helper Award (2016)  

MHB Best Ideas (2016)  

MHB LaTeX Award (2016)  

MHB Calculus Award (2014)  

MHB Discrete Mathematics Award (Jul-Dec 2013)
    #4
    Quote Originally Posted by ineedhelpnow View Post
    could you be a little more specific? i dont really understand how to do it since i have like lowercase and uppercase alpha and beta
    So it's like:

  5. MHB Journeyman

    Status
    Offline
    Join Date
    Jul 2014
    Posts
    805
    Thanks
    599 times
    Thanked
    698 times
    Awards
    Chat Box Champion (2014)
    #5 Thread Author
    ok so could you explain the <handle 'a' or 'A'.....> part. im not familiar with it

  6. MHB Master
    MHB Site Helper
    MHB Math Scholar

    Status
    Offline
    Join Date
    Jan 2012
    Posts
    2,151
    Thanks
    505 times
    Thanked
    4,026 times
    Thank/Post
    1.872
    Awards
    MHB Chat Room Award (2016)  

MHB Humor Award (2016)  

MHB Discrete Mathematics Award (2016)  

MHB Best Ideas Award (2015)  

MHB Discrete Mathematics Award (2015)
    #6
    Quote Originally Posted by ineedhelpnow View Post
    could you explain the <handle 'a' or 'A'.....> part. im not familiar with it
    "<handle 'a' or 'A'.....>" means that you should replace it with the code according to your instructions, namely: If 'a' or 'A', print "Alpha". That is, you should replace "<handle 'a' or 'A'.....>" in ILS's code with the line that prints the string "Alpha".

    For more about the
    switch
    statement in C and C++, see and or, better, read your textbook or lecture notes.

Similar Threads

  1. Proving these statements
    By nacho in forum Advanced Applied Mathematics
    Replies: 1
    Last Post: August 13th, 2014, 07:37
  2. Finding a recurrence relation where (k - 1)th switch must be on to turn on kth switch
    By find_the_fun in forum Discrete Mathematics, Set Theory, and Logic
    Replies: 3
    Last Post: November 27th, 2013, 07:56
  3. Which one of these two statements is wrong ?
    By Yankel in forum Linear and Abstract Algebra
    Replies: 4
    Last Post: February 14th, 2013, 03:34
  4. Which one of these statements is wrong ?
    By Yankel in forum Linear and Abstract Algebra
    Replies: 5
    Last Post: January 26th, 2013, 07:41
  5. equivalent statements
    By dwsmith in forum Analysis
    Replies: 4
    Last Post: September 11th, 2012, 07:59

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Math Help Boards