Question

Write a python program for the following problem?

100. Cost of Electricity formula The cost of the electricity used by a device is given by the cost of electricity (in dollars

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Screenshot of the code:

#Prompt the user to enter the wattage, #hours and price in cents. wattage = int(input(Enter wattage: )) hours = int(input (

Sample Output:

Enter wattage: 100 Enter number of hours used: 720 Enter price per kWh in cents: 11.76 Cost of electricity: $6.12

Code To Copy:

#Run the code in python version 3.x.

#Indent the code as per the above screenshot of the code.

#Prompt the user to enter the wattage,
#hours and price in cents.
wattage = int(input("Enter wattage: "))
hours = int(input("Enter number of hours used: "))
price = float(input("Enter price per kWh in cents: "))

#Compute the cost of electricity.
Cost = (wattage * hours)/(1000 * price);

#Display the output, Cost of electricity.
print("Cost of electricity: $"+"{:.2f}".format(Cost));

Add a comment
Know the answer?
Add Answer to:
Write a python program for the following problem? 100. Cost of Electricity formula The cost of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Problem 2 If the cost of electricity in your area is 12 cents per kWh, what...

    Problem 2 If the cost of electricity in your area is 12 cents per kWh, what is the total cost (capital plus operation) of using a 60-W incandescent bulb for 1000 hours (the lifetime of that bulb) if the bulb cost 25 cents? If we replace this bulb with a compact fluorescent light that provides the same light output, but at one- quarter the wattage, and which costs $1.50 but lasts 10 times longer (10,000 hours), what will that total...

  • The electric company charges according to the following rate schedule: 9 cents per kilowatt-hour (kwh) for...

    The electric company charges according to the following rate schedule: 9 cents per kilowatt-hour (kwh) for the first 300 kwh 8 cents per kwh for the next 300 kwh (up to 600 kwh) 6 cents per kwh for the next 400 kwh (up to 1000 kwh) 5 cents per kwh for all electricity used over 1000 kwh Write a program that would repeatedly read in a customer number (an integer) and the usage for that customer in kwh (an integer)....

  • INSTRUCTION AND PROBLEMS Write a Python program for each of the problems in this lab. Please...

    INSTRUCTION AND PROBLEMS Write a Python program for each of the problems in this lab. Please use PyCharm to type and test your programs. Submit the Python files to Blackboard for credit. In this lab, you should submit 4 Python files, one for each problem PROBLEM I Energy consumption is measured in units of kilowatt hours (kWh). The more kWh a household use in a month, the higher the energy bll. A power company charges customers $0.12 per kWh for...

  • Problem 4: A machine shop purchases electricity at the following rates: First 100 kWh at 13.0...

    Problem 4: A machine shop purchases electricity at the following rates: First 100 kWh at 13.0 cents per kWh. Next 200 kWh at 11.7 cents per kWh Next 300 kWh at 10.5 cents per kWh. Over 600 kWh at 9.5 cents per kWh. Be accurate to at least two decimal places for all the following problems (a) (3 pts.) The shop uses 392 kWh/month. (a.1) What is the total cost per month (S/month)? (a.2) Average cost (cents/kWh) (a.3) Marginal cost...

  • Need help with this please Lab 14 Electricity Bill Worksheet Background knowledge. The power of an...

    Need help with this please Lab 14 Electricity Bill Worksheet Background knowledge. The power of an electrical appliance is measured in watt (W). One watt is a measure of the energy used up in one second. The unit used for calculating power consumption is the kilowatt-hour (kWh). In order to calculate power consumed by an electrical appliance, we first convert the power to kilowatt (kW). For example, 800 W=0.8 kW, 2000 W = 2.0 kW and so on. One unit...

  • Program using  Python Q#1 Cost of Bagels: A bagel shop charges 8C cents per bagel for orders...

    Program using  Python Q#1 Cost of Bagels: A bagel shop charges 8C cents per bagel for orders of less than a half-dozen bagels and 60 cents per bagel for orders of a half-dozen or more. Write a program that requests the number of bagels ordered and displays the total cost. How many bagels are ordered: 12 The cost of 12 bagels is $7.20. Q#2 Overtime Pay. Federal law requires that hourly employees be paid "time-and-a-half" for work in excess of 40...

  • Write a C++ program that creates the following eight two dimensional random number vector: (a) the...

    Write a C++ program that creates the following eight two dimensional random number vector: (a) the voltage vector V[][] contains n X m voltages between 100 and 1000 Volts, (where n.= #rows, m=# columns) (b) the current vector I[][] contains nXm currents between 10 and 50 Amps, (c) the phase vector PH[][] contains nXm phase angles between 0 and 45 degrees (d) The power vector (units of Watts) is given by: P[][] = V[][]*I[]*cos(PH[][]*M_P1/180); (e) The reaction vector (units of...

  • PLEASE HELP WITH CODE PYTHON BASE.!!!!!!!! Tasks: Complete the following programs noted below: Problem 1: A...

    PLEASE HELP WITH CODE PYTHON BASE.!!!!!!!! Tasks: Complete the following programs noted below: Problem 1: A painting company has determined that for 112 square feet of wall space, one gallon of paint and eight hours of labor will be required. The company charges $35.00 per hour for labor. Write a program that asks the user to enter the square feet of wall space to be painted and the price of paint per gallon. The program should display the following data:...

  • PROBLEM 3-13 Identifying Cost Behavior Pattern A number of graphs displaying cost behavior patterns are shown...

    PROBLEM 3-13 Identifying Cost Behavior Pattern A number of graphs displaying cost behavior patterns are shown below. The vertical axis on each graph represents total cost, and the horizontal axis represents level of activity (volume). Required: 1. For each of the following situations, identify the graph below that illustrates the cost behavior pattern involved. Any graph may be used more than once. Cost of raw materials used. Electricity billa flat fixed charge, plus a variable cost after a certain number...

  • I need to write a paint job estimator program in python. I have most of it...

    I need to write a paint job estimator program in python. I have most of it down but i keep getting errors and I dont know how to fix it or what im doing worng specs: A painting company has determined that for every 350 square feet of wall space, one gallon of paint and six hours of labor are required. The company charges $62.25 per hour for labor. Write a program call paintjobestimator.py that asks the user to enter...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT