COS 100: Introduction to Programming

Fall 2019

HW Project 03: Counting credits

Due: 10/02 Wed 10pm

Now therefore, if you will indeed obey My voice and keep My covenant, then you shall be a special treasure to Me above all people; for all the earth is Mine. And you shall be to Me a kingdom of priests and a holy nation.
Exodus 19:5–6a

Project goal

You are to determine whether you are eligible to graduate and if so, whether you will graduate with honors. This program could replace a transactional aspect of a meeting with an academic advisor, and instead use that time to focus on more important issues such as calling, mission, and vocation.

Project specification

Notes and hints

Suggested order of development

This program is going to be longer than your previous program. The best approach is to plan it all out ahead of time, and then add just one or two pieces at a time, and test out what you just added before moving on. For example:
  1. Create a program that only asks about whether you have 122 credits; check to make sure it behaves correctly.
  2. Add the question about credits for your major; test that just those two questions are working correctly in all their different combinations.
  3. Add a question about the most recent 35 credits, etc.

Sample runs

  1. How many credits do you have? 128
    How many credits does your major require? 54
    Of those 54 credits, how many did you take at Bethel? 27
    Of your most recent 35 credits, how many did you take at Bethel? 35
    What is your GPA? 1.9
    You need a higher GPA.
    
  2. How many credits do you have? 130
    How many credits does your major require? 52
    Of those 52 credits, how many did you take at Bethel? 17
    You need to take more major credits at Bethel.
    
  3. How many credits do you have? 122
    How many credits does your major require? 60
    Of those 60 credits, how many did you take at Bethel? 54
    Of your most recent 35 credits, how many did you take at Bethel? 32
    What is your GPA? 3.75
    How many of your credits did you complete at Bethel? 67
    You graduate Cum Laude.  Congratulations!
    
  4. How many credits do you have? 122
    How many credits does your major require? 30
    Of those 30 credits, how many did you take at Bethel? 15
    Of your most recent 35 credits, how many did you take at Bethel? 28
    What is your GPA? 2.0
    You graduate.  Congratulations!
    

Before moving on

Ponder how much care a programmer would need in order to implement policies and rules. Marvel at how much work must have gone into software like Degree Works that allow Bethel students (and advisors) to track your progress towards a degree. If you are employed by a bank to author an automated mortgage approval system based on various criteria, a tiny coding error could potentially affect many people's lives by erroneously declining their mortgage applications. With great power comes great responsibility.

Start early, have fun, and discuss questions on Moodle.