Please check my answers. 2.5 pts Question 9 What is the correct way to express this formula in Python? units produced - units rejected / machine productivity = machine hours x hourly cost machine_productivity = units_produced - units_rejected / (machine_hours * hourly_cost) machine_productivity = units_produced - units_rejected / (machine_hours * hourly_cost) machine_productivity = units_produced - units_rejected / (machine_hours * hourly_cost) machine_productivity = units_produced - units_rejected / machine_hours * hourly_cost Question 10 2.5 pts This code will tell the user whether the number they entered is a multiple of 4. What must replace the blank in the condition to complete the code? num_to_check = int(input("What number would you like to check? ")) if num_to_check % 4 == 0: print("The number is a multiple of 4.") else: print("The number is not a multiple of 4.")
Added by Jesus M.
Close
Step 1
So the correct code is: num_to_check = int(input("What number would you like to check? ")) Show more…
Show all steps
Your feedback will help us improve your experience
Lottie Adams and 58 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Task: Design a modular program in Python to process payroll for all hourly paid employees and save all user-entered data and processed results to a txt file. The program should allow the user to enter each employee's ID, name, hours worked, and hourly pay rate. It should then calculate the gross pay, taking into account overtime hours (hours beyond 40) paid at a rate of 50% more. The program should display a pay statement for each employee. Finally, the program should display the total number of employees, the total number of hours worked by all employees, and the total gross pay. The program should contain the following functions: main(), getEmployeeInfo(), calcGrossPay(hours, rate), displayPayStatement(empID, empName, hoursWorked, hourlyPayRate, grossPay), and savePayStatement(empID, empName, hoursWorked, hourlyPayRate, grossPay). The getEmployeeInfo() function should return the employee's ID, name, hours worked, and hourly pay rate.
Supreeta N.
1.14 Warm-up: Basic output with variables (Python 3) A variable like userNum can store a value like an integer. Extend the given program to print userNum values as indicated. (1) Output the user's input. Enter integer: 4 You entered: 4 (2) Extend to output the input squared and cubed. Hint: Compute squared as userNum * userNum. Enter integer: 4 You entered: 4 4 squared is 16 And 4 cubed is 64!! (3) Extend to get a second user input into userNum2. Output the sum and product. Enter integer: 4 You entered: 4 4 squared is 16 And 4 cubed is 64!! Enter another integer: 5 4 + 5 is 9 4 * 5 is 20
Liam H.
Python Homework Instructions: The tax calculator program of the case study outputs a floating-point number that might show more than two digits of precision. Use the round function to modify the program to display at most two digits of precision in the output number. Below is an example of the program input and output: Enter the gross income: 12345.67 Enter the number of dependents: 1 The income tax is $-130.87 # Edit the code below """ Program: taxform.py Author: Ken Lambert Compute a person's income tax. 1. Significant constants - tax rate - standard deduction - deduction per dependent 2. The inputs are - gross income - number of dependents 3. Computations: - taxable income = gross income - the standard deduction - a deduction for each dependent - income tax = is a fixed percentage of the taxable income 4. The outputs are - the income tax """ # Initialize the constants TAX_RATE = 0.20 STANDARD_DEDUCTION = 10000.0 DEPENDENT_DEDUCTION = 3000.0 # Request the inputs grossIncome = float(input("Enter the gross income: ")) numDependents = int(input("Enter the number of dependents: ")) # Compute the income tax taxableIncome = grossIncome - STANDARD_DEDUCTION - DEPENDENT_DEDUCTION * numDependents incomeTax = round(taxableIncome * TAX_RATE, 2) # Display the income tax print("The income tax is $" + str(incomeTax))
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD