Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Lisa_Kramarenko

Exercise OPT.2 – Secret Messages (Homework 1) I don't really get the step 3. Why should the values remain in range (0,5)? Or rather why do we have to do the modulus? Somehow I don't see how do I do it after I managed to replace all the letters with "x"'s. Thanks!

  • one year ago
  • one year ago

  • This Question is Closed
  1. Screech
    Best Response
    You've already chosen the best response.
    Medals 1

    I think I expressed a similar question when our class hit this exercise. You can review the thread of the discussion here http://openstudy.com/study#/updates/508f05b9e4b043900ad89834 Hope that the discussion which ensued clarifies the exercise for you

    • one year ago
  2. aznation
    Best Response
    You've already chosen the best response.
    Medals 0

    I agree with Screech's thread. That step is just poorly worded and can be basically ignored. Just focus on creating a function that will take a user's string input and return an ascii shifted message back. That is the purpose of the exercise. Good luck.

    • one year ago
  3. aznation
    Best Response
    You've already chosen the best response.
    Medals 0

    Looked closer at Opt.2 Secret Messages exercise: first I simply shifted the ascii value over by the designated amount ('A' = 65, shift 4 over would be '69'). This works fine for all characters except the last 9 of the set (88-97) and (120-129). These outer cases are where they expect us to modify our ascii character using the modulus operator to keep the secret letter value within the range A-Z or a-z respectively. Handle each range using for loops and the 'ord' and 'chr' functions from the examples.

    • one year ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.