Question: 1. Write a program that prompts the user to enter the amount of consumed water in gallons and electricity in watts. The program calculates the

1. Write a program that prompts the user to enter the amount of consumed water in gallons and electricity in watts. The program calculates the bill assuming that the water and electricity rates are as in the following table:

Water Gallons 200 200 and 850 850 < Rate 0.75 1.15 2.75

Input/Output Sample:

Enter the consumed water : 1025

Enter the consumed electricity : 3110

The bill for 1025 gallons of water and 3110 watts pf electricity is 3116 dirhams.

2. Write a program that prompts the user to enter three words. The program sorts and prints the words in ascending order.

Enter three words: Banana Apple Cherry

Apple Banana Cherry

Water Gallons 200 200 and 850 850 < Rate 0.75 1.15 2.75 Electricity Watts 2500 2500 < Rate 0.5 0.8

Step by Step Solution

3.47 Rating (173 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Sure Lets tackle this problem step by step Program 1 Calcul... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (2 attachments)

PDF file Icon

60960ec3cb4cd_26553.pdf

180 KBs PDF File

Word file Icon

60960ec3cb4cd_26553.docx

120 KBs Word File

Students Have Also Explored These Related Programming Questions!