Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I'm working on question 4 here and anytime I input 1,2 or 3, my it prints invalid program.... not sure where I'm going wrong here.
I'm working on question 4 here and anytime I input 1,2 or 3, my it prints "invalid program".... not sure where I'm going wrong here.
2. Write a while loop that computes the sum of all even numbers between 1 and 100 (inclusive). You may add this code to the code for problem 1 3. Write a while loop that computes the sum of the squares of the numbers between 1 and 15 (inclusive). You may add this code to the code for problems 1 and 2 4. Using the lecture slides as a guide, create a menu so that the user can choose whether to execute the loop in problem 2, the loop in problem 3, or exit the program. See Lecture slides 19 and 20 of week 5 lecture one. A sample menu is shown below: 1. Sum even numbers to 100 2. Sum squares from 1 to 15 3. QUIT sum 5.1c.py - C:/Users/Elijah/AppData/local/Programs/Python/Python38-32/CS 110/5.1c.py (3.8.2) File Edit Format Run Options Window Help done = False while not done: print("Welcome to the Menu...") print("1 Find the sum of all numbers between 1 and 100") print("2 - Find the sum of the squares of numbers between 1 and 15") print("3. Exit") answer input("Enter your choice: ") it answer == 1: TARGETVALUE = 100 sum = 0 n = 1 while n
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started