Begin with Program 1 from Activity 4 of last week's LabAssignment1b. You are to convert that program to a new program that produces identical output. However, for all of the calculations, you are to...


Please help me with this coding. (See image)


Begin with Program 1 from Activity 4 of last week's LabAssignment1b. You are to convert that program<br>to a new program that produces identical output. However, for all of the calculations, you are to instead<br>create variables for all values that are either constants or are values that might vary in the calculation.<br>Recall the following example from LabAssignment1b:<br># calculate/print area of rectangle of length 5 in. and height 3 in.<br>print (

Extracted text: Begin with Program 1 from Activity 4 of last week's LabAssignment1b. You are to convert that program to a new program that produces identical output. However, for all of the calculations, you are to instead create variables for all values that are either constants or are values that might vary in the calculation. Recall the following example from LabAssignment1b: # calculate/print area of rectangle of length 5 in. and height 3 in. print ("Area of rectangle is",5 * 3, "in^2") # area of rectangle in in^2 print () New code: New output: Area of rectangle is 15 in^2 Now, we know about variables and assignments statements, so let's modify the code as follows: # calculate/print area of rectangle of length 5 in. and height 3 in. length = 5 # inches height area = length * height # in^2 print ("Area of rectangle is", area, "in^2") print () Newer code: %3D = 3 # inches # area of rectangle in in^2 Newer output: Area of rectangle is 15 in^2

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here