Question Objectives: XXXXXXXXXXThe objectives of this lab exercise are to: 1. Demonstrate an understanding of the concept of operator precedence in Python expressions and statements. 2. Take simple...

Assignment attached via PDF attachment


Question Objectives: The objectives of this lab exercise are to: 1. Demonstrate an understanding of the concept of operator precedence in Python expressions and statements. 2. Take simple problem descriptions and produce small but complete Python programs that solve these problems. 3. Give you some practice in using simple Python interactive input and output capabilities. 4. Give you some practice in the simplest Python decision statement (if). 5. Give you some practice in the simplest Python loop statement (while). Specifications: This is a four-part exercise. 1. For the three assignment statements listed below, label the operators according to the order they will be evaluated, i.e., label the first evaluated operator with a 1, the second with a 2, and so on. Then fill in the blank with the result assigned to variable x in each part. i. x = 7 + 3 * 6 / 2 – 1 x = ________ ii. x = 2 % 2 + 2 * 2 – 2 / 2 x = ________ iii. x = ( 3 * 9 * ( 3 + ( 9 * 3 / 3 ) ) ) x = ________ 2. Write a Python program that inputs three (3) integers to IDLE from the keyboard and prints the sum, average, product, smallest and largest of these numbers. For this exercise you may assume the user does NOT enter any duplicate values. The interactive screen dialogue should look something like this (user input is shown in bold): Input three different integers separated by : 13 27 14 Sum is 54 Average is 18 Product is 4914 Smallest is 13 Largest is 27 3. Write a Python program in IDLE that asks for the radius of a circle and prints the circle’s diameter, circumference, and area. Import the math library for p. Do the calculations for diameter, circumference and area in the output statements. You do NOT need variables for holding your calculated values of diameter, circumference, or area. Just place the appropriate expression as an argument to the print() function. 4. Write a Python program in IDLE that asks for an integer and determines and prints whether it is odd or even. (Hint: Use the modulus operator (%). An even number is a multiple of 2 and any multiple of 2 leaves a remainder of zero (0) when divided by 2). Discussion: In addition to the documentation requirements specified in lab 1, first write the entire program in pseudocode as comments. When necessary place a comment to the right of complicated lines to clarify your code to the reader. Further, comments should not merely repeat what is obvious from a program statement. For example, avoid what follows. This statement below adds nothing to understanding what the statement does or what its purpose is within the program: Sum = Sum + 1 # Add 1 to Sum ß A totally worthless comment! Deliverable(s): Your deliverable should be a Word document with screenshots showing the sample code you have created, and discuss the issues that you had for this project related to AWS and/or Python IDE and how you solved them. Turn in your source code listings for the programs developed above. Include screen shots of the results from running the programs you developed for three (3) sets of test data (for each program). Choose your test cases carefully so they reflect good values to test all aspects of your solutions.
Jul 23, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here