Question

In: Computer Science

An electricity company charges electricity consumption according to the following scale. Up to 200 Units (0-200)...

An electricity company charges electricity consumption according to the following scale.
Up to 200 Units (0-200) to 0.25 € per unit
The next 1000 Units (201-1200) to 0.40 € per unit

Over 1200 units to 0.50 € per unit.
Write a program in python language that accepts the number of units consumed by the customer and displays the amount of money owed by the customer to the electricity company

Solutions

Expert Solution

#reading units from user
n=int(input("Enter number of units: "))
total=0
#if units are less than 200
if(n<=200):
        total=n * 0.25
#if units are less than 1200 and greater than 200
elif(n<=1200):
        total=200 * 0.25
        total = total + (n-200) * 0.4
else: #if units are >1200
        total=200 * 0.25
        total = total + 1000 * 0.4
        total = total + (n-1200) * 0.5

print("Total price for ",n,"units $",total)

NOTE : PLEASE COMMENT BELOW IF YOU HAVE CONCERNS.

Please Like and Support me as it helps me a lot


Related Solutions

Suppose a gas company bases its charges on consumption according to the following table: Gas Charges...
Suppose a gas company bases its charges on consumption according to the following table: Gas Charges Gas Used Rate First 70 cubic meters $5.00 minimum cost Next 100 cubic meters $0.05 per cubic meter Next 230 cubic meters $0.025 per cubic meter Above 400 cubic meters    $0.015 per cubic meter    Write a program in C++ that asks the user to enter the number of cubic meters of gas used, calculates the charges, and displays the total charge.
A vertical scale on a spring balance reads from 0 to 200 N. The scale has...
A vertical scale on a spring balance reads from 0 to 200 N. The scale has a length of 10.0 cm from the 0 to 200 N reading. A fish hanging from the bottom of the spring oscillates vertically at a frequency of 2.05 Hz.Ignoring the mass of the spring, what is the mass m of the fish?
According to the International Atomic Energy Agency, per capita electricity consumption in Canada was 16,939 kWh...
According to the International Atomic Energy Agency, per capita electricity consumption in Canada was 16,939 kWh in 2002. A random sample of 51 households was monitored for one year to determine electricity usage. If the population standard deviation of annual usage is 3,500 kWh, what is the probability that the sample mean will be each of the following? a.More than 18,000 kWh b.More than 17,500 kWh c.Between 17,000 kWh and 18,000 kWh d.Less than 16,000 kWh e.Less than 15,000 kWh
Assume that the consumption function is given by C = 200 + 0, 75(Y − T)....
Assume that the consumption function is given by C = 200 + 0, 75(Y − T). Investment is 100; government purchases and taxes are both 100. (a) This economy has TODAY a GDP of 1700, is this an equilibrium level of GDP? (HINT: Find the AS the AD and compare them). (b) Will the GDP NEXT WEEK increase or decrease? (HINT: looking to your previous answer see if AS is lower or higher than AD, then think what will happen...
According to Southern California Edison(SCE) the mean electricity consumption during winter is 1650 kwh per month...
According to Southern California Edison(SCE) the mean electricity consumption during winter is 1650 kwh per month in Los Angeles area. Assume electric consumption have a normal distribution with a mean of 1650 kwh and a standard deviation of 320 kWh. SCE sent a notice to you informing that about 90% of the households use less electricity than you do. a. what is your monthly electricity consumption? b. Assume SCE conducted a telephone survey In Los Angeles area between December 2019...
A company claims that the mean monthly residential electricity consumption in a certain region is more...
A company claims that the mean monthly residential electricity consumption in a certain region is more than 890 ​kiloWatt-hours (kWh). You want to test this claim. You find that a random sample of 69 residential customers has a mean monthly consumption of 930 kWh. Assume the population standard deviation is 125 kWh. At alphaequals0.10​, can you support the​ claim? Complete parts​ (a) through​ (e). ​(a) Identify Upper H 0 and Upper H Subscript a. Choose the correct answer below. A....
A company claims that the mean monthly residential electricity consumption in a certain region is more...
A company claims that the mean monthly residential electricity consumption in a certain region is more than 890 ​kiloWatt-hours (kWh). You want to test this claim. You find that a random sample of 69 residential customers has a mean monthly consumption of 930 kWh. Assume the population standard deviation is 125 kWh. At alphaequals0.10​, can you support the​ claim? Complete parts​ (a) through​ (e). ​(a) Identify Upper H 0 and Upper H Subscript a. Choose the correct answer below. A....
Disposable Income Consumption 0 $200 billion $200 billion 300 billion 400 billion 400 billion 600 billion...
Disposable Income Consumption 0 $200 billion $200 billion 300 billion 400 billion 400 billion 600 billion 500 billion 800 billion 600 billion How much is the marginal propensity to consume when disposable income rises from $600 billion to $800 billion? Select one: a. 0.65 b. 0.5 c. 0.75 d. 0.85
A Vespa rental company charges a $200 premium for an insurance policy on a rental. If...
A Vespa rental company charges a $200 premium for an insurance policy on a rental. If the Vespa is totaled, the insurance policy will cover the full cost of replacing the Vespa, $5000. For minor damage, the policy will cover $1000 in repair costs. The probability of the Vespa getting totaled is 0.004, while the probability that it will sustain minor damage is 0.1. What is the expected value of the policy for the company?
The following information is provided by Panther​ Company: WIP​ Inventory, January 1 0 units Units started...
The following information is provided by Panther​ Company: WIP​ Inventory, January 1 0 units Units started ​22,000 units Units completed and transferred out ​9,000 units WIP​ Inventory, December 31 ​13,000 units Direct materials $24,800 Direct labor $13,300 Manufacturing Overhead $11,300 The units were​ 80% complete for materials and​ 30% complete for conversion costs. How much are the total costs to be accounted for during the​ year? A. $24,600 B. $24,800 C. $38,100 D. $49,400
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT