0% found this document useful (0 votes)
58 views1 page

User Input Calculations Guide

The document contains 4 questions that accept user input and perform calculations based on rates and criteria. Question 1 displays the second largest of 3 numbers. Question 2 calculates an electric bill based on usage tiers. Question 3 calculates a bill for kilometers traveled with different rates for ranges. Question 4 displays wages based on age, sex, and rates in a table.

Uploaded by

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

User Input Calculations Guide

The document contains 4 questions that accept user input and perform calculations based on rates and criteria. Question 1 displays the second largest of 3 numbers. Question 2 calculates an electric bill based on usage tiers. Question 3 calculates a bill for kilometers traveled with different rates for ranges. Question 4 displays wages based on age, sex, and rates in a table.

Uploaded by

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

Q1) Accept three numbers from the user and display the second largest number.

Q2) Accept the electric units from user and calculate the bill according to the following
rates.
First 100 Units : Free
Next 200 Units : Rs 2 per day.
Above 300 Units : Rs 5 per day.
if number of unit is 500 then total bill = 0 +400 + 1000 = 1400

Q3) Accept the kilometers covered and calculate the bill according to the following criteria:
First 10 Km Rs11/km
Next 90Km Rs 10/km
After that Rs9/km

Q4) Accept the age, sex (‘M’, ‘F’), number of days and display the wages accordingly

Age Sex Wage/day

>=18 and <30 M 700

F 750

>=30 and <=40 M 800

F 850

You might also like