# File: moveOn2.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 grade 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: ") # for everyone, an A or B counts as passing the class if grade == "A" or grade == "B": print("You can take CMSC 202!") elif grade == "C": # for CMSC and CMPE majors, a C is not enough to pass if major == "CMSC" or major == "CMPE": print("You cannot move on to CMSC 202.") # for all other majors, a C is enough else: print("You can take CMSC 202!") # any other grade does not count as passing, regardless of major else: print("You cannot move on to CMSC 202.") main()