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
-
Name your project source code
advising.py
. -
The full list of graduation requirements can be found in the Bethel Catalog (or by talking to your academic advisor).
We will use the following simplified rules:
- You must have at least 122 credits.
- You must take at least half of your major credits at Bethel.
- You must take at least 28 of your most recent 35 credits at Bethel.
- You must have a GPA of at least 2.0.
- If you verify that you are able to graduate, also determine whether you are eligible for honors based on these tables, which are different depending on whether a student has taken at least 68 credits at Bethel.
- Ask for each piece of info as a separate question.
- Make sure you don't ask the user for any information that isn't necessary. E.g., if the user indicates they don't have at least 122 credits, don't bother asking the other questions, because you already know they can't graduate.
- Don't ask for the same information more than once. E.g., if the user already told you their GPA, you should still remember it.
- Once you have all the necessary information, tell the user what their graduation status is.
Notes and hints
- You can assume that the user will always answer with an integer for questions about credits, and a floating point number for questions about GPA. (Later we'll talk about what to do if the user enters unexpected input.)
- It is strongly recommended that you plan out your program before you start coding. Create a flowchart of all possible paths through your program to make sure you don't miss any cases. If you plan your program well, it can be very easy to code up. If you don't plan it well, you could end up with a much longer and messier program.
-
From this project and onward, you will also be graded on coding style.
Use descriptive variable names, follow variable naming convention of
lowercase_words_with_underscores
orcamelCase
, write comments as necessary, and don't have excessively long lines.
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:- Create a program that only asks about whether you have 122 credits; check to make sure it behaves correctly.
- Add the question about credits for your major; test that just those two questions are working correctly in all their different combinations.
- Add a question about the most recent 35 credits, etc.
Sample runs
-
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.
-
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.
-
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!
-
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.