Question

In: Computer Science

Desktop test If the consumption does not exceed 400 kWh, the cost is $ 0.1 /...

Desktop test

If the consumption does not exceed 400 kWh, the cost is $ 0.1 / kWh
(2) If consumption exceeds 400 kWh but does not exceed 800 kWh, the first 400 kWh is charged at
$ 0.1 / kWh and excess at $ 0.2 / kWh
(3) Consumption exceeding 800 kWh is charged the same as (2) but in addition the customer is fined
$ 100
(4) There is a basic charge of $ 20 that is charged independent of customer consumption
(5) Customers who live in rural areas have a discount of 10% of the total bill
(6) Commercial customers have an additional tax of 7% of the total invoice
(7) For rural and commercial clients an additional tax of 4% (not 7%, nor the discount of
10%)
Your program must present to the customer the total to be paid in the most detailed way possible, for example, for a
non-rural commercial client that consumed 1000kWh, the output should be something like:
For your report, run the program for the cases shown below. Present PrtScrs of the input and the
output, and its corresponding desktop tests.
(1) Non-rural, non-commercial, 200 kWh
(2) Rural, non-commercial, 10kWh
(3) Rural, non-commercial, 500 kWh
(4) Rural, commercial, 700 kWh
(5) Non-rural, commercial, 1200 kWh
(6) Non-rural, non-commercial 1200 kWh
(7) Rural, non-commercial 1200 kWh

Is Phyton

is Phyton

Solutions

Expert Solution

Hi,

please find the code below.

#Desktop test
units=int(input("Number of unit consumed in Kwh(kilo watt per hour: "))
cityOrRural= input("Enter if its a rural area or city:Rural/Non-rural ")
CommOrHousehold = input("Enter if its a commercial or household purpose:commercial/Non-commercial")

#variable declaration
fixedcharge=20.00 # basic charges for everyone
discount=0.00
tax=0.00
TotalInvoicewithdiscount=0.00
TotalInvoicewithdiscountntax=0.00

if(units>0 and units<=400):
payAmount=units*0.1 # below 400 its 0.1 per KW
elif(units>400 and units<=800):
payAmount=(400*0.1)+(units-400)*0.2 #first 400 at 0.1 and remaining at 0.2
elif(units>800):
payAmount=(400*0.1)+(units-400)*0.2+100 #same as before plus 100 fine
else:
payAmount=0;
  
TotalInvoice= payAmount+fixedcharge
print("\nElecticity bill pay without tax or dicount =%.2f: " %TotalInvoice);

if(cityOrRural == "Rural" and CommOrHousehold == "Non-commercial"): # doscount applied only for rural non commercial people
discount=10

if(CommOrHousehold == "commercial" and cityOrRural == "Non-rural"):
tax=7

if(CommOrHousehold == "commercial" and cityOrRural == "Rural"):
tax=4

if(discount>0.00):
TotalInvoicewithdiscount = TotalInvoice - (TotalInvoice*(discount/100))
else:
TotalInvoicewithdiscount = TotalInvoice

if(tax>0.00):
TotalInvoicewithdiscountntax = TotalInvoicewithdiscount - (TotalInvoicewithdiscount*(tax/100))
else:
TotalInvoicewithdiscountntax = TotalInvoicewithdiscount

print("No of units consumed:",units)
print("Rural or Non-Rural:",cityOrRural)
print("commercial or Non-commercial:",CommOrHousehold)
print("basic pay amount:",payAmount)
print("fixedcharges:",fixedcharge)
print("total invoice:",TotalInvoice)
print("discount:",discount)
print("Tax:",tax)
print("Amount after discount:",TotalInvoicewithdiscount)
print("Amount after tax:",TotalInvoicewithdiscountntax)

code snapshot:

Output:

Kindly upvote.

Thanks,

Amruth


Related Solutions

"Provided our consumption does not exceed its natural level of production, the burning of biomass should...
"Provided our consumption does not exceed its natural level of production, the burning of biomass should generate no more heat and create no more carbon dioxide than would have been formed in any case by natural processes." What do you think about this in terms of long-term wood burning to heat homes in rural areas? Specifically under what circumstances would you consider this acceptable or unacceptable?
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
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...
Just need the desktop test for this two function a) Write a function that receives the...
Just need the desktop test for this two function a) Write a function that receives the number of terms (n) and returns a container with the first n TunaPoke numbers. Present a "print screen" of the results and their respective desktop test when the function is invoked with the 16. (b) Write a function that receives a limit number and returns a container with the first numbers TunaPoke that do not exceed the specified limit. Present a "print screen" of...
To test Ho: ? = 400 versus H1: ? > 400, a simple random sample of...
To test Ho: ? = 400 versus H1: ? > 400, a simple random sample of n = 100 is obtained. Assume the population standard deviation is 80. If the researcher decides to test this hypothesis at the ?? = .05 level of significance, compute the probability of making a Type II Error if the true population mean is 420. What is the power of the test?
Explain how the the annual cost per kWh is calculated for alternative power sources including wind,...
Explain how the the annual cost per kWh is calculated for alternative power sources including wind, fossil fuels, and nuclear. As part of your discussion, explain why it is important to make comparisons this way.   This question is from Chapter 24: Wind Energy Power Company, Inc: Analyzing a Wind Energy Investment. Hint: See Appendix 24.3. 2.Refer to Exhibit 24.5, Panel A. Which type of energy had the lowest cost per kWh to produce electricity in July 2008? This question is...
A school is interested in whether its student's scores on a standardized test exceed the national...
A school is interested in whether its student's scores on a standardized test exceed the national average. The national average is 40 (μ = 40) and the standard deviation is 8 (cr = 8). To determine this, the school officials administer the test to a sample of 16 (n = 16) students and obtain a mean score of 44 (M = 44). Perform a z-test to determine whether the students in the school differ significantly from the national average. Perform...
1. Suppose that the MPC is equal to 0.8 and autonomous consumption spending is 400. Then...
1. Suppose that the MPC is equal to 0.8 and autonomous consumption spending is 400. Then the consumption function is given by a. C = 400 - 0.8Yd b. C = -400 + 0.2Yd c. C = 320 x Yd d. C = 400 + 0.8Yd e. C = 400 + 0.2Yd 2. Suppose that the MPC is equal to 0.8 and autonomous consumption spending is 400. At what level of income is saving = 0? a. 400 b. 500...
THERMODYNAMICS EXPERT You have a 0.1 mole/sec stream of propane at T = 400 K and...
THERMODYNAMICS EXPERT You have a 0.1 mole/sec stream of propane at T = 400 K and P = 7.5 MPa. You isothermally and reversibly compress the pressure to 10 MPa using a intercooler compressor. Find the amount of heat dumped into the environment and the amount of work needed to compress the propane.
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
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT