Calculate and display the water bill

Assignment Help Basic Computer Science
Reference no: EM131080776

Problem:

A town uses a two-tier system to calculate bill for water usage.  For the first 8000 gallons, it is $0.004 per gallon.  After the first 8000 gallons, the rate will be $0.007 per gallon. Suppose a customer uses 8500 gallons of water.  He will pay $0.004 per gallon for the first 8000 gallons, and $0.007 per gallon for the last 500 gallons. Write a Python program to determine how much a customer needs to pay.  Ask the user how much water he has used.  Calculate and display the water bill. The following are two examples.

Enter gallons of water used: 2100

Please pay this amount: $8.4

Enter gallons of water used: 8500

Please pay this amount: $35.5

Reference no: EM131080776

Questions Cloud

Single backup file : Why might an administrator need to only restore a single or small subset of files that are contained in a single backup file containing many files and folders?
Assignment-apple versus samsun : Apple iPads continue to be successful. The Samsung Galaxy Tab is one (1) of iPad's competitors. Use the Internet and Strayer Library to research the advantages and disadvantages of these devices and to determine if they are comparable.
Describe ftp protocol : 1. Describe FTP protocol? 2. What are the layer ports numbers used by FTP? 3. Describe SCP?
Determine the deflection of the beam : Determine the deflection of the beam when it is subjected to a load per unit length, w, over the section x = x1 to x = x2. What is the maximum deflection if x1 = 0 and x2 = l?
Calculate and display the water bill : Write a Python program to determine how much a customer needs to pay.  Ask the user how much water he has used.  Calculate and display the water bill. The following are two examples.
For what does the case acronym stand : For what does the CASE acronym stand? In general, what is the purpose of CASE tools? What types of individuals are most likely to use CASE tools?
Categories of personal productivity software packages : List at least five categories of personal productivity software packages. Then concentrate on one of these categories, and describe a representative product in that category with which you are somewhat familiar.
Capability and features of three well-known nms : This week, you will prepare a research report summarizing the capability and features of three well-known NMSs.
Compute the laplace transforms of given functions : Determine an annihilator for x2 e3x + 5 cos 2x. Convert the following system to a first-order system: d2x/dt2 -3dy/dt+x = sint,  d2y/dt2 -tdx/dt-e'y=t2

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Determine the advantages an investigator gains

1) Assess the importance of forensics in network-based crimes and incidents. Determine the advantages an investigator gains by having the ability to analyze network-based crimes. Propose how you, as someone in a management position, would emphasize t..

  Compare and contrast the us health care system with that

compare and contrast the u.s. health care system with that of another country. what are some of the major advantages

  Determining the rest for kernel data

Assuming 64KB of program flash memory and 64KB of data SRAM, assign values to BMXxxxBA special function registers to partition the program flash memory into 50KB for kernel program and rest for user program; and partition the data SRAM into 10KB f..

  Evaluate the effectiveness of the physical and environmental

Evaluate the effectiveness of the physical and environmental security measures that the organization you researched used in regard to protecting its assets. Indicate improvements to the organization's security measures where applicable. Justify your ..

  Prepare the case budget for the fourth quarter

Using a spreadsheet to prepare the case budget for the fourth quarter. The cash budget should be included as an appendix to the written report and should be referenced in the written report.

  Why random access file instead of a sequential access file

Write a 200- to 300-word response to the following question: In which situations would you choose to use a direct access or random access file instead of a sequential access file? Give a specific example and explain your reasoning.

  Roduce an error message for any input value less than 1582

roduce an error message for any input value less than 1582

  Find a regular expression for the language

Find a regular expression for the language over {a,b} that consists of all strings containing exactly one occurrence of substring ab.

  Design suitable mechanism to solve graph coloring problem

Consider a graph coloring problem where we have a very large graph G = (V, E), whose vertices are to be colored using 3 distinct colors such that no adjacent node in G has the same color. Design a suitable mechanism to solve the given problem.

  Write a program with the output hello world hello

Write a program with the following output: (Notice the newline and space) Hello world! Hello

  Use the method of iteration to find a formula

Use the method of Iteration to find a formula expressing S(n) as a function of n for the given recurrence relation and initial condition

  Explain how decision problem is decidable

Think of the way to mark all variables A such that for some string x ∈ Σ*, A (⇒*(over)G) x. Describe algorithm in detail.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd