My code I getting this Traceback (most recent call last): File "/usercode/main.py", line 46, in cs261_answer = input("\nQUESTION 8\nHave you taken CS261? (Yes or No): ").strip().upper() EOFError: EOF when reading a line
My code I getting this Traceback (most recent call last): File "/usercode/main.py", line 46, in cs261_answer = input("\nQUESTION 8\nHave you taken CS261? (Yes or No): ").strip().upper() EOFError: EOF when reading a line
Chapter6: Using Arrays
Section: Chapter Questions
Problem 2CP
Related questions
Question
My code I getting this Traceback (most recent call last):
File "/usercode/main.py", line 46, in <module>
cs261_answer = input("\nQUESTION 8\nHave you taken CS261? (Yes or No): ").strip().upper()
EOFError: EOF when reading a line
File "/usercode/main.py", line 46, in <module>
cs261_answer = input("\nQUESTION 8\nHave you taken CS261? (Yes or No): ").strip().upper()
EOFError: EOF when reading a line
required_cs_credits_earned = 0
# Print the header
print("--------------------------------")
print(" UIC CS Track")
print("--------------------------------\n")
# QUESTION 1: Are you a CS major?
major_answer = input("QUESTION 1\nAre you a CS major? (Yes or No): ").strip().upper()
if major_answer == "YES":
# QUESTION 2: Have you taken ENGR100?
engr100_answer = input("\nQUESTION 2\nHave you taken ENGR100? (Yes or No): ").strip().upper()
# QUESTION 3: Have you taken CS111?
cs111_answer = input("\nQUESTION 3\nHave you taken CS111? (Yes or No): ").strip().upper()
if cs111_answer == "YES":
required_cs_credits_earned += 3
# QUESTION 4: Have you taken CS141?
cs141_answer = input("\nQUESTION 4\nHave you taken CS141? (Yes or No): ").strip().upper()
if cs141_answer == "YES":
required_cs_credits_earned += 3
cs151_answer = input("\nQUESTION 5\nHave you taken CS151? (Yes or No): ").strip().upper()
if cs151_answer == "YES":
required_cs_credits_earned += 3
cs211_answer = input("\nQUESTION 6\nHave you taken CS211? (Yes or No): ").strip().upper()
if cs211_answer == "YES":
required_cs_credits_earned += 3
cs251_answer = input("\nQUESTION 7\nHave you taken CS251? (Yes or No): ").strip().upper()
if cs251_answer == "YES":
required_cs_credits_earned += 4
cs277_answer = input("Have you taken CS277? (Yes or No): ").strip().upper()
if cs277_answer == "YES":
required_cs_credits_earned += 3
cs377_answer = input("Have you taken CS377? (Yes or No): ").strip().upper()
if cs377_answer == "YES":
required_cs_credits_earned += 3
cs401_answer = input("Have you taken CS401? (Yes or No): ").strip().upper()
if cs401_answer == "YES":
required_cs_credits_earned += 3
cs261_answer = input("\nQUESTION 8\nHave you taken CS261? (Yes or No): ").strip().upper()
if cs261_answer == "YES":
required_cs_credits_earned += 4
# Print the summary for CS majors
print("\n--------------------------------")
print(" Summary")
print("--------------------------------\n")
print("You are a CS major!")
if engr100_answer == "NO":
print("Do not forget to take ENGR100!")
print(f"\nRequired CS credits earned: {required_cs_credits_earned}.")
else:
# Print the summary for non-CS majors
print("\n--------------------------------")
print(" Summary")
print("--------------------------------\n")
print("Sadly, you are not a CS major.")
# Goodbye message
print("\nThank you for using App!")
print("Closing app...")
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps
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,
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,