Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

More Books

Students also viewed these Databases questions