# File: moveOn1.py # Author: Dr. Gibson # Date: 2/12/2018 # Section: N/A # E-mail: k.gibson@umbc.edu # Description: # This file contains python code that asks the user for # their major and grade, and prints out whether they are # eligible to move on to CMSC 202 in the next semester. # This version uses nested decisions, with the # student's major as the outer decision. def main(): # get major and grade from the user major = input("Please enter your major: ") grade = input("Please enter your grade: ") if major == "CMSC" or major == "CMPE": # for CMSC and CMPE majors, an A or B is needed if grade == "A" or grade == "B": print("You can take CMSC 202!") else: print("You cannot move on to CMSC 202.") # not a CMSC or CMPE major else: # for all other majors, an A, B, or C is enough if grade == "A" or grade == "B" or grade == "C": print("You can take CMSC 202!") else: print("You cannot move on to CMSC 202.") main()