Question: 1. Write a Python statement(s) that accomplish the following: (20 Points) a) Declare int variables x and y. Initialize x to 25 and y to

 1. Write a Python statement(s) that accomplish the following: (20 Points)

1. Write a Python statement(s) that accomplish the following: (20 Points) a) Declare int variables x and y. Initialize x to 25 and y to 18. b) Declare and initialize an int variable temp to 10 and a string variable ch to 'A' c) Update the value of an int variable x by adding 5 to it. d) Declare and initialize a float variable payRate to 12.50. e) Copy the value of an int variable firstNum into an int variable tempNum 2. Do a walk-through to find the value assigned to e. Assume that all variables are properly declared. (20 Points) a=3 b-4 c- (a% b)* 4 d=c/b e=(a + b + c + d) / 6 3. Ifx 15, y-7,z-4, and w-2.5, evaluate each of the following statements, if possible. If it is not possible, state the reason. (20 Points) a) (x+y)%w b) (y+w)%x c) (x%y)%z 4. Write a complete program that computes the distance based on the rate and time. All values should be in by the user. The equation for computing the distance, rate and time is Distance rate /time

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 Databases Questions!