Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q) Kahrama Electricity Tariff for domestic buildings is layers-based. As the consumption increases, the tariff for each layer increases. When Kahrama employee comes to read

image text in transcribed
Q) Kahrama Electricity Tariff for domestic buildings is layers-based. As the consumption increases, the tariff for each layer increases. When Kahrama employee comes to read a building's consumption (in kilowatts), he takes the whole number displayed on the meter, and ignores the fractional part. The .....1- mowe the murrent electricity tariff: For example, if a commercial building consumed 12500KW, then wo nu.......... 11 be based on 3 layers and is calculated as follows: \[ \text { bill_amount }=0.13 * 2000+0.17 * 4000+0.22 *(\text { consumption }-5000)=2,590 \mathrm{QR} \text {. } \] Write a Python program that does the following: 1. Prompt the user to enter the electricity_consumption (in KW). 2. If the electricity_consumption is less than 1 , then assign 0.0 to the variable bill_amount. (Hint: no else is needed here) 3. Using an if/elif/else control structure and the electricity consumption ranges given above, assign the correct bill amount to the variable bill_amount. (Hint: do not use a print statement in the ifleliflelse control structure). 4. Using f-strings, produce two output lines: the first displays the user's data and the second displays the bill amount in QR and the number of layers used to calculate the bill. Format your input and output as shown in the two examples given below: Enter the Electricty meter reading (KW):12500 Electricity Consumption: 12500 Electricity Bill =QR2590.0 [Layer 3] Enter the Electricty meter reading (KW) :2400 Electricity Consumption: 2400

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

Beginning C# 2005 Databases

Authors: Karli Watson

1st Edition

0470044063, 978-0470044063

More Books

Students also viewed these Databases questions

Question

Reasons why section 43 of Canadian criminal code is just

Answered: 1 week ago