MY CODE print("--------------------------------") print(" UIC CS Track") print("--------------------------------") print() # Ask if the user is a CS major cs_major_answer = input("QUESTION 1\nAre you a CS major? (Yes or No): ").strip().upper() # Initialize earned credit hours to 0 earned_credit_hours = 0 # Check if the user is a CS major if cs_major_answer == "YES": # Ask if the user has taken ENGR100 print("\nQUESTION 2") engr100_answer = input("Have you taken ENGR100? (Yes or No): ").strip().upper() # Check if the user has taken ENGR100 if engr100_answer == "YES": # Increment earned credit hours by 0 for ENGR100 earned_credit_hours += 0 # Ask about "Level 1" CS classes print("\nQUESTION 3") cs111_answer = input("Have you taken CS111? (Yes or No): ").strip().upper() if cs111_answer == "YES": earned_credit_hours += 3 # Ask about "Level 2" CS classes print("\nQUESTION 4") cs141_answer = input("Have you taken CS141? (Yes or No): ").strip().upper() if cs141_answer == "YES": earned_credit_hours += 3 print("\nQUESTION 5") cs151_answer = input("Have you taken CS151? (Yes or No): ").strip().upper() if cs151_answer == "YES": earned_credit_hours += 3 # Ask about "Level 3" CS classes print("\nQUESTION 6") cs211_answer = input("Have you taken CS211? (Yes or No): ").strip().upper() # Regardless of the answer to CS211, ask question 7 print("\nQUESTION 7") cs251_answer = input("Have you taken CS251? (Yes or No): ").strip().upper() # Ask about CS277, CS377, and CS401 only if CS251 is taken if cs251_answer == "YES": earned_credit_hours += 4 print("Have you taken CS277? (Yes or No): ", end='') cs277_answer = input().strip().upper() if cs277_answer == "YES": earned_credit_hours += 3 print("Have you taken CS377? (Yes or No): ", end='') cs377_answer = input().strip().upper() if cs377_answer == "YES": earned_credit_hours += 3 print("Have you taken CS401? (Yes or No): ", end='') cs401_answer = input().strip().upper() if cs401_answer == "YES": earned_credit_hours += 3 print("\nQUESTION 8") cs261_answer = input("Have you taken CS261? (Yes or No): ").strip().upper() if cs261_answer == "YES": earned_credit_hours += 4 # Display the summary print("\n--------------------------------") print(" Summary") print("--------------------------------") print() if cs_major_answer == "YES": print("You are a CS major!") print() print("Required CS credits earned:", earned_credit_hours, end=".") else: print("Sadly, you are not a CS major.") print() print("\nThank you for using App!") print("Closing app...") ----------------------------------------------------------------------------- The only issue with this code is that it does not add credits correctly all the time... fix it so that the credits are added correctly while keeping the exact same format on the output...I'm pretty sure the issue has something to do with question 7 where it doesn't add correctly there
MY CODE print("--------------------------------") print(" UIC CS Track") print("--------------------------------") print() # Ask if the user is a CS major cs_major_answer = input("QUESTION 1\nAre you a CS major? (Yes or No): ").strip().upper() # Initialize earned credit hours to 0 earned_credit_hours = 0 # Check if the user is a CS major if cs_major_answer == "YES": # Ask if the user has taken ENGR100 print("\nQUESTION 2") engr100_answer = input("Have you taken ENGR100? (Yes or No): ").strip().upper() # Check if the user has taken ENGR100 if engr100_answer == "YES": # Increment earned credit hours by 0 for ENGR100 earned_credit_hours += 0 # Ask about "Level 1" CS classes print("\nQUESTION 3") cs111_answer = input("Have you taken CS111? (Yes or No): ").strip().upper() if cs111_answer == "YES": earned_credit_hours += 3 # Ask about "Level 2" CS classes print("\nQUESTION 4") cs141_answer = input("Have you taken CS141? (Yes or No): ").strip().upper() if cs141_answer == "YES": earned_credit_hours += 3 print("\nQUESTION 5") cs151_answer = input("Have you taken CS151? (Yes or No): ").strip().upper() if cs151_answer == "YES": earned_credit_hours += 3 # Ask about "Level 3" CS classes print("\nQUESTION 6") cs211_answer = input("Have you taken CS211? (Yes or No): ").strip().upper() # Regardless of the answer to CS211, ask question 7 print("\nQUESTION 7") cs251_answer = input("Have you taken CS251? (Yes or No): ").strip().upper() # Ask about CS277, CS377, and CS401 only if CS251 is taken if cs251_answer == "YES": earned_credit_hours += 4 print("Have you taken CS277? (Yes or No): ", end='') cs277_answer = input().strip().upper() if cs277_answer == "YES": earned_credit_hours += 3 print("Have you taken CS377? (Yes or No): ", end='') cs377_answer = input().strip().upper() if cs377_answer == "YES": earned_credit_hours += 3 print("Have you taken CS401? (Yes or No): ", end='') cs401_answer = input().strip().upper() if cs401_answer == "YES": earned_credit_hours += 3 print("\nQUESTION 8") cs261_answer = input("Have you taken CS261? (Yes or No): ").strip().upper() if cs261_answer == "YES": earned_credit_hours += 4 # Display the summary print("\n--------------------------------") print(" Summary") print("--------------------------------") print() if cs_major_answer == "YES": print("You are a CS major!") print() print("Required CS credits earned:", earned_credit_hours, end=".") else: print("Sadly, you are not a CS major.") print() print("\nThank you for using App!") print("Closing app...") ----------------------------------------------------------------------------- The only issue with this code is that it does not add credits correctly all the time... fix it so that the credits are added correctly while keeping the exact same format on the output...I'm pretty sure the issue has something to do with question 7 where it doesn't add correctly there
Chapter12: Using Controls
Section: Chapter Questions
Problem 11RQ
Related questions
Question
MY CODE
print("--------------------------------")
print(" UIC CS Track")
print("--------------------------------")
print()
# Ask if the user is a CS major
cs_major_answer = input("QUESTION 1\nAre you a CS major? (Yes or No): ").strip().upper()
# Initialize earned credit hours to 0
earned_credit_hours = 0
# Check if the user is a CS major
if cs_major_answer == "YES":
# Ask if the user has taken ENGR100
print("\nQUESTION 2")
engr100_answer = input("Have you taken ENGR100? (Yes or No): ").strip().upper()
# Check if the user has taken ENGR100
if engr100_answer == "YES":
# Increment earned credit hours by 0 for ENGR100
earned_credit_hours += 0
# Ask about "Level 1" CS classes
print("\nQUESTION 3")
cs111_answer = input("Have you taken CS111? (Yes or No): ").strip().upper()
if cs111_answer == "YES":
earned_credit_hours += 3
# Ask about "Level 2" CS classes
print("\nQUESTION 4")
cs141_answer = input("Have you taken CS141? (Yes or No): ").strip().upper()
if cs141_answer == "YES":
earned_credit_hours += 3
print("\nQUESTION 5")
cs151_answer = input("Have you taken CS151? (Yes or No): ").strip().upper()
if cs151_answer == "YES":
earned_credit_hours += 3
# Ask about "Level 3" CS classes
print("\nQUESTION 6")
cs211_answer = input("Have you taken CS211? (Yes or No): ").strip().upper()
# Regardless of the answer to CS211, ask question 7
print("\nQUESTION 7")
cs251_answer = input("Have you taken CS251? (Yes or No): ").strip().upper()
# Ask about CS277, CS377, and CS401 only if CS251 is taken
if cs251_answer == "YES":
earned_credit_hours += 4
print("Have you taken CS277? (Yes or No): ", end='')
cs277_answer = input().strip().upper()
if cs277_answer == "YES":
earned_credit_hours += 3
print("Have you taken CS377? (Yes or No): ", end='')
cs377_answer = input().strip().upper()
if cs377_answer == "YES":
earned_credit_hours += 3
print("Have you taken CS401? (Yes or No): ", end='')
cs401_answer = input().strip().upper()
if cs401_answer == "YES":
earned_credit_hours += 3
print("\nQUESTION 8")
cs261_answer = input("Have you taken CS261? (Yes or No): ").strip().upper()
if cs261_answer == "YES":
earned_credit_hours += 4
# Display the summary
print("\n--------------------------------")
print(" Summary")
print("--------------------------------")
print()
if cs_major_answer == "YES":
print("You are a CS major!")
print()
print("Required CS credits earned:", earned_credit_hours, end=".")
else:
print("Sadly, you are not a CS major.")
print()
print("\nThank you for using App!")
print("Closing app...")
-----------------------------------------------------------------------------
The only issue with this code is that it does not add credits correctly all the time... fix it so that the credits are added correctly while keeping the exact same format on the output...I'm pretty sure the issue has something to do with question 7 where it doesn't add correctly there
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 8 steps with 7 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT