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

susanjrobertson Group Title

Can anyone help out with the 1.8 exercises? I'm a bit stuck on both 3 and 4.

  • 2 years ago
  • 2 years ago

  • This Question is Closed
  1. peterdb Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    !.8 q3 I haven't coded it yet, but an exponential is just repeated multiplication so a**3 is a*a*a It looks like the number of times the multiplication takes place could be controlled by the loop.

    • 2 years ago
  2. susanjrobertson Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Thanks, I think I got the exp and base one, just working on the even number one now. I keep getting an infinite loop :)

    • 2 years ago
  3. peterdb Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    If the while loop tests for an odd number, control should fall out of it when an even number is entered.?

    • 2 years ago
  4. susanjrobertson Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Yeah, I get it to not be infinite now, but I believe it is supposed to keep asking you to enter an even number until you do, so that's all I have left, but I'll have to do that another day.

    • 2 years ago
  5. exchaoordo Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    The thing is you need to ask for the number in TWO places. Once before you enter the loop and then once inside the loop. At least that's what I did.

    • 2 years ago
  6. mmailliw Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    The way I did it was I began by creating a test variable and setting it to False I then created a loop that ran while the test variable was False; in this loop, I prompted for the number, checked that it was even, and changed the test variable to True if it was. If the entry was something other than an even number, the test variable stayed False, the loop restarted, and the user was prompted again.

    • 2 years ago
  7. susanjrobertson Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Thanks all for the help - I got it :)

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