Question: Chapter 2 Lab Use Variables, and Arithmetic Operators Instructions: 1 . Write your programs in Python. 2 . Include comments in each program; start with

Chapter 2 Lab Use Variables, and Arithmetic Operators Instructions: 1. Write your programs in Python. 2. Include comments in each program; start with your name as the first comment. 3. Display all your answers to each problem (such as flowcharts, pseudocode, and screenshot of your output) in a word document. Make sure each problem and part of the problem is correctly labelled, ie. Problem 1 Part a), Part b) and Problem 2 Part a), Part b). Upload this Word file. 4. Also, if you wish to write the code, upload the file containing the programs code saved as a text file or py file and accompanying video that demonstrates your code being ran in the Python editor. Problem 1(2 pts): Given the expression 403**2+8/3**2*10 a) What is the output of the above expression? Check your answer by writing and running a program in the W3Schools, Python code editor. Place a screenshot in your Word document with the correct label (Problem 1, Part a). b) Based on precedence and associativity of the arithmetic operators. Correctly parenthesize the expression such that you get the same output as in part (a) Check your answer by writing and running a program in the Python editor. Type your response in the Word document and label correctly. Problem 2: (3 pts): Predict the output and check your answer by writing and running a program in the Python editor. Type your prediction and include a screenshot of your response for a, b, and c. a)2**2**3 b)2**(2**3) c)(2**2)**3 Problem 3: (3 pts): a) Create a flowchart and pseudocode that shows the logic for the following. You do not have to write the code, just show the logic of the following with a flowchart and pseudocode. A program that prompts the user to input an integer that represents an amount in cents (less than 1.00). You can call it pocketChange. The program will then calculate the smallest combination of coins that the user has. For example, 32 cents is 1 quarter, 1 nickel, and 2 pennies, so: - pocketChange is .32. Is .32>.25, then 1 quarter and subtract .25 from pocketChange -Is pocketChange (now .07>.10-Is pocketChange >.05, then 1 nickel, and subtract .05 from pocketChange -Is pocketChange (now .02>.01, then 1 penny and subtract .01 from pocketChange. -Is pocketChange more than or less than 1 b) Optional: Write the programs code in the Python editor, include the video that demonstrate your code and running of code. (2 pts)
Chapter 2 Lab Use Variables, and Arithmetic

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!