In this lab exercise, you will become familiar with accepting user input using Wing IDE. The primary objective of this lab is to learn to create variables that will store user input, then use that input in a calculation to be displayed to the Output Window. You will be provided with two test Cases to use when executing your program. Parts of the program has been written for you. A sample output, using the first test case data, is shown below. Standard Input: • Type the following program segment into Wing IDE, and complete Python code as described in each comment: ~ print(“This program will calculate the average of three grades.”) # Write a Python statement that will ask the user for the first grade, stored in variable grade1 (Remove this line and add Python statement here) # Write a Python statement that will ask the user for the second grade, stored in variable grade2 (Remove this line and add Python statement here) # Write a Python statement that will ask the user for the third grade, stored in variable grade3 (Remove this line and add Python statement here) average = (grade1 + grade2 + grade3) / 3 # Write a Python print the average to the Output Window (Remove this line and add Python statement here) print(“This program will calculate the average of three grades.”) # Write a Python statement that will ask the user for the first grade, stored in variable grade1 (Remove this line and add Python statement here) # Write a Python statement that will ask the user for the second grade, stored in variable grade2 (Remove this line and add Python statement here) # Write a Python statement that will ask the user for the third grade, stored in variable grade3 (Remove this line and add Python statement here) average = (grade1 + grade2 + grade3) / 3 # Write a Python print the average to the Output Window (Remove this line and add Python statement here) • After completing the lines of code after each comment, in green, run your program. Correct any errors. • Use the following Test Cases and paste a print screen of your output for each in the specified spaces provided below. (NOTE: You will need to execute your code for each test case, as the test case data is what you will input while executing the code.) Test Case 1: grade1 = 80 grade2 = 76.3 grade3 = 91
In this lab exercise, you will become familiar with accepting user input using Wing IDE. The primary objective of this lab is to learn to create variables that will store user input, then use that input in a calculation to be displayed to the Output Window. You will be provided with two test Cases to use when executing your
Standard Input: • Type the following program segment into Wing IDE, and complete Python code as described in each comment: ~
print(“This program will calculate the average of three grades.”) # Write a Python statement that will ask the user for the first grade, stored in variable grade1 (Remove this line and add Python statement here) # Write a Python statement that will ask the user for the second grade, stored in variable grade2 (Remove this line and add Python statement here) # Write a Python statement that will ask the user for the third grade, stored in variable grade3 (Remove this line and add Python statement here) average = (grade1 + grade2 + grade3) / 3 # Write a Python print the average to the Output Window (Remove this line and add Python statement here) print(“This program will calculate the average of three grades.”) # Write a Python statement that will ask the user for the first grade, stored in variable grade1 (Remove this line and add Python statement here) # Write a Python statement that will ask the user for the second grade, stored in variable grade2 (Remove this line and add Python statement here) # Write a Python statement that will ask the user for the third grade, stored in variable grade3 (Remove this line and add Python statement here) average = (grade1 + grade2 + grade3) / 3 # Write a Python print the average to the Output Window (Remove this line and add Python statement here) • After completing the lines of code after each comment, in green, run your program. Correct any errors. • Use the following Test Cases and paste a print screen of your output for each in the specified spaces provided below. (NOTE: You will need to execute your code for each test case, as the test case data is what you will input while executing the code.)
Test Case 1: grade1 = 80 grade2 = 76.3 grade3 = 91
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images