Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise #1: Phone Bill: Write a program that computes the monthly pay of your water bill. The Water Company computes the charges as follow: every

image text in transcribed

Exercise #1: Phone Bill: Write a program that computes the monthly pay of your water bill. The Water Company computes the charges as follow: every customer pays a fixed subscription fee of 50 Dirhams. For the first 1000 liters, the cost per liter is 0.75 Dirham. For the extra liters (exceeding 1000 liters), the cost per liter is 1.25 Dirhams. . . Sample input/output: Enter the number of water liters you consumed: 700 The total water bill = 575 Dirhams Enter the number of water liters you consumed: 1500 The total water bill = 1425 Dirhams Exercise #2: Comparing digits of a number: Write a program that reads a two-digit number from a user. Then, the program prints the two digits in two separate lines. If the first digit is larger than the second digit, print their sum in the third line. Otherwise, print their product in the third line. Sample input/output: Enter a two-digit number: 83 First digit : 8 Second digit : 3 The sum of the digits = 11 Enter a two-digit number: 27 First digit : 2 Second digit : 7 The product of the digits = 14

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_2

Step: 3

blur-text-image_3

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

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions

Question

Does talking equal effective communication?

Answered: 1 week ago