Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Lisa_Kramarenko

  • 2 years ago

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!

  • This Question is Closed
  1. Screech
    • 2 years ago
    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

  2. aznation
    • 2 years ago
    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.

  3. aznation
    • 2 years ago
    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.

  4. Not the answer you are looking for?
    Search for more explanations.

    Search OpenStudy
    • Attachments:

Ask your own question

Ask a Question
Find more explanations on OpenStudy

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.