Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

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

Step: 1

1 include include include include using name... 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

Document Format ( 2 attachments)

PDF file Icon
60960ec3cb4cd_26553.pdf

180 KBs PDF File

Word file Icon
60960ec3cb4cd_26553.docx

120 KBs Word File

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

Introduction to Java Programming, Comprehensive Version

Authors: Y. Daniel Liang

10th Edition

133761312, 978-0133761313

More Books

Students also viewed these Programming questions

Question

Brief the importance of span of control and its concepts.

Answered: 1 week ago

Question

What is meant by decentralisation?

Answered: 1 week ago

Question

Write down the Limitation of Beer - Lamberts law?

Answered: 1 week ago

Question

Discuss the Hawthorne experiments in detail

Answered: 1 week ago

Question

The domain of the variable in the expression x 3/x + 4 is________.

Answered: 1 week ago

Question

ii. Tenacity Study?

Answered: 1 week ago