Hey all, I want to revamp some of my assignments this coming semester. One of the first projects I always start with is something to get some hands-on experience with conditional logic. However, these projects are getting pretty stale at this point. So, I’m turning to this community for some fresh ideas.

Keep in mind, these assignments are for brand-new programmers within the first 2-4 weeks of the course. At this point, they won’t have really been taught loops, functions, collections, etc., beyond that they exist. They really just know basic syntax, variable types, and terminal input and output. This is where they will practice working with boolean expressions and selection statements like if-else, if-else if-else, and switch.

Here’s what I’ve been doing for some reference:

  • Write a program to turn an integer grade into a letter grade.

    • 50 -> F
    • 81 -> B-
    • 99 -> A+
  • Write a program to convert a number from 1 to 7 into the corresponding day of the week.

    • 1 -> Monday
    • 7 -> Sunday
  • Write a program that determines the time necessary for sound to travel a given distance in a given medium.

    • 500ft, water -> 0.1s
    • 1500ft, air -> 1.3s
  • Write a program that determines the total price of a bulk order of widgets, with discounts for orders over a certain amount according to some table.

    • 30 -> $30
    • 500 -> $300
  • Write a program that determines the quadrant of a given point.

    • 15, 7 -> Quadrant I
    • 6, -4 -> Quadrant IV