Created
September 12, 2012 18:58
-
-
Save Jam6808/3709107 to your computer and use it in GitHub Desktop.
Credit organizer, asks for input and returns the based on a query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org | |
import classes | |
#The driver for the program | |
def main(): | |
print('This is a college credit organizer') | |
#This takes the function and calls it and sets it equal to a variable, I expect either 180 or 120 based on their schools system. | |
credits_need = org.CreditsNeeded() | |
#This checks to make sure a valid response, I expect if there is no value it exits | |
if credits_need == None: | |
pass | |
#This will ask the series of question that are needed for a "database" and set the dictionary, in this case equal to classes to be used later on. | |
classes = org.get_classes() | |
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Asks user for their schedule to get amount of credits needed. | |
#This function is needed to be able to calculate the total credits needed to graduate school. I expect it to ask what kind of class(Quarter or Semester and then give a int based on that answer) For example, if quarter is chosen 180 would be the int. | |
def CreditsNeeded(): | |
#sets up a running total | |
chances = 0 | |
#asks user for their school type | |
schedule = input('What kind of schedule are you on?(Quarter or Semester): ') | |
schedule = schedule.lower() | |
#Loops to give credits_needs | |
while chances < 2: | |
if schedule == 'quarter': | |
credits_needed = 180 | |
return credits_needed | |
if schedule == 'semester': | |
credits_needed = 120 | |
return credits_needed | |
if schedule != 'quarter' and schedule != 'semester': | |
print('Error: Invalid option') | |
print('Please Try again',end='\n') | |
chances += 1 | |
schedule = input('What kind of schedule are you on?(Quarter or Semester): ') | |
schedule = schedule.lower() | |
if chances >= 2: | |
print('Sorry was not able to process your information') | |
#creates the class dictionary to track the total credits taken. Not sure if it should use a dictionary | |
class_credits = {} | |
#gets grade a list for that grade | |
#This function is used to ask the general questions I expect it to ask "What grade", "What type" , "What class" and "how many credits its worth" | |
def get_classes(): | |
grade = input('What grade is this for?(Enter to exit): ') | |
dept = input('What type of class is it?: ') | |
Class = input('What class is it?: ') | |
credit = input('How many credits is it worth?: ') | |
return class_credits | |
#creates a helper function for validation | |
def validate(x): | |
x = x.strip() | |
x = x.lower() | |
return x | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment