Unit 3 Write Code for Toggle Code

This is the write code problems associated with the mixed up code problems.

Write code that tests guess to see if it is equal to answer or too high or too low. If it is too high as in the example below, it should print out Your guess is too high.

Write code that prints You can go out if you don’t have any homework and have cleaned and otherwise prints You can not go out.

Write code that tests if x is between 1 and 10, and prints 1 <= x <= 10 or x is not in range.

Write code that prints out if the string message has the word ringing in it or not. It should print out Answer the phone! if ringing is in message, and I don't hear anything. if not.

Write code that prints if your favorite food is junk food (pizza or wings) or not. Your code should check to see if the variable favFood value is pizza or wings. If it is, it should print out Your fav is junk food. If not, it should print Your fav is not junk.

Write code that prints your fine if you are speeding. If you are going over 65 but less than 75, the fine is 50. If you are going at least 75 and less than 85, the fine is 100. Over that the fine is 200. It should not print anything if you are not speeding.

Write code that prints the alarm time. If it is a weekday you should get up at 7:00am and if not get up at 10:00am.

Write code that prints if you Can text now or Can't text now. You can text if you are not driving and not eating.

Write code that prints whether your name Starts with a vowel (a, e, i, o, u) or Starts wwith a consonant.

Write code that prints the letter grade with your score. For a score greater than 90, it should print A. For a score between 80 and 90, it should print B. For a score between 70 and 80, it should print C. For a score between 60 and 70, it should print D. For all other scores, it should print E.

You have attempted of activities on this page