Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#1,2 and 4 PYTHON Downloads/ xGet Hormework Help With Chegy x+ localhost8888otebooks/Downloads/04-Assignment-olipynb jupyter 04-Assignment-01 Last Checkpoint a day ago (autosaved) Logout File Edit View nsert

image text in transcribedimage text in transcribed#1,2 and 4 PYTHON

Downloads/ xGet Hormework Help With Chegy x+ localhost8888otebooks/Downloads/04-Assignment-olipynb jupyter 04-Assignment-01 Last Checkpoint a day ago (autosaved) Logout File Edit View nsert Cell Widgets Help Trusted Python 3 O 1) Complete the following program that does salary calculations for employees. The code below contains the basic logic. a) You will need to add a loop to continue calculations until the user types in "done" (sentinel b) You will add code to perform the following input validations - check to ensure the number of hours worked is more than 0 but less than 80 In [ ]: H # complete code using Instructions above basehr-40 basepay 18 hours-int(input('Enter Hours Worked)) while (hours and hoursbasehr: ot_hr-hours-basehr pay (basehr basepay)+(ot hr*basepay 1.5) else: pay (hours *basepay) print('Your pay is $', pay, sep) 2) Ask the user to type in an integer greater than 50 and assign it to a variable called x. Write a program to calculate the sum of squares of positive integers. The loop should stop when the sum is greater than x. At the end of the loop print how many numbers were used to calculate the sum. For example, if x is 100, sum will be 91, and six numbers (1 to 6) were used to calculate sum. In []: x-int (input( Enter a number greater than 50:) sum=e 7:47 PM Type here to search 3/7/2019 Downloads/ e Gel Homework Help with ChegLX localhost8888otebooks/Downloads/04-Assignment-olipynb jupyter 04-Assignment-01 Last Checkpoint a day ago (unsaved changes) Logout File Edit View nsert Cell Widgets Help Trusted Python 3 input x postive integers. rite a program to tind tne iargest odd number entered by the user In [* largest--1 x-int(input( Enter a positive number: )) for i in range (x): num=int( nput() ) if num%2=-1 and num largest: largest-num print ("Largest odd number is ",largest) Enter a positive number: 4) Ask the user to type in a positive integer and assign it to a variable called x (this represents how many numbers the user plan to enter). The user will then input x postive integers. Write a program to find the smallest number entered by the user. In [ ]: x=int(input("Enter smallest-None a positive number : . )) 7:49 PM Type here to search 3/7/2019

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

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions