0% found this document useful (0 votes)
7 views2 pages

Utility Bill and Cost Calculations

The document outlines three problems related to calculations: electricity bill, BMI, and total tour cost. Each problem includes a formula for calculation, input requirements, and expected output format, emphasizing the restriction of not using conditional statements or loops. Examples are provided for clarity on input and output expectations.

Uploaded by

shirinayasmin33
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Utility Bill and Cost Calculations

The document outlines three problems related to calculations: electricity bill, BMI, and total tour cost. Each problem includes a formula for calculation, input requirements, and expected output format, emphasizing the restriction of not using conditional statements or loops. Examples are provided for clarity on input and output expectations.

Uploaded by

shirinayasmin33
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Problem 1: Electricity Bill Calculation

Problem Statement:
You are given the number of electricity units consumed in a month. The electricity bill is calculated using
the formula:
Bill = (Units * CostPerUnit) + FixedCharges + (Units * CostPerUnit * TaxPercent / 100)
Write a program to compute the total electricity bill. Do not use any conditional statements or loops.
Input:
• First line: Units (integer, 1 ≤ Units ≤ 10000)
• Second line: CostPerUnit (float, 0 < CostPerUnit ≤ 100)
• Third line: FixedCharges (float, 0 ≤ FixedCharges ≤ 500)
• Fourth line: TaxPercent (float, 0 ≤ TaxPercent ≤ 20)
Output:
• Single line: Total electricity bill rounded to 2 decimal places.
Example:
Input:
350
5.5
50
10
Output:
2317.50

Problem 2: Body Mass Index (BMI) Calculation


Problem Statement:
Write a program to calculate the BMI of a person using the formula:
BMI = Weight / (Height * Height)
Do not use any conditional statements or loops.
Input:
• First line: Weight (float, in kg, 10 ≤ Weight ≤ 200)
• Second line: Height (float, in meters, 0.5 ≤ Height ≤ 2.5)
Output:
• Single line: BMI rounded to 2 decimal places.
Example:
Input:
70
1.75
Output:
22.86
Problem 3: Total Tour Cost Calculation
Problem Statement:
A traveler wants to calculate the total cost of a tour. The total cost is computed as:
TotalCost = (Days * CostPerDay) + TransportCost + HotelCost + (Days * CostPerDay *
ServiceChargePercent / 100)
Do not use any conditional statements or loops.
Input:
• First line: Days (integer, 1 ≤ Days ≤ 365)
• Second line: CostPerDay (float, 0 < CostPerDay ≤ 10000)
• Third line: TransportCost (float, 0 ≤ TransportCost ≤ 5000)
• Fourth line: HotelCost (float, 0 ≤ HotelCost ≤ 10000)
• Fifth line: ServiceChargePercent (float, 0 ≤ ServiceChargePercent ≤ 15)
Output:
• Single line: Total tour cost rounded to 2 decimal places.
Example:
Input:
5
2000
1500
3000
10
Output:
14100.00

You might also like