subject
Computers and Technology, 10.11.2019 05:31 any71

Write a program to store water usage data of 4 customers in a text file. the program asks the user to enter account number, customer type (r for residential or b for business), and number of gallons used for each of the 4 customers. store the data in a text file named "water. txt". overwrite old data in "water. txt" if the file already exists. the following is an example.
enter account number: 3147
enter r for residential, b for business: r
enter number of gallons used: 1000
enter account number: 2168
enter r for residential, b for business: r
enter number of gallons used: 6002
enter account number: 5984
enter r for residential, b for business: b
enter number of gallons used: 2000
enter account number: 7086
enter r for residential, b for business: b
enter number of gallons used: 8002
the example above writes the following data to the file "water. txt":
3147 r 1000
2168 r 6002
5984 b 2000
7086 b 8002
answer with code i can use with pycharm for python programming?

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:00
As with any small island country, cuba has fewer natural resources than countries such as brazil. this affects their economy in that cuba a) exports only manufactured products. b) exports more products than it imports.. c) must import more products than it exports. d) has imposed trade barriers against the united states.
Answers: 3
question
Computers and Technology, 23.06.2019 02:00
Which software would you use to create a print design? a. illustrator b. audacity c. reaper d. dreamweaver
Answers: 2
question
Computers and Technology, 23.06.2019 05:00
In cell b18, enter a formula to calculate the amount budgeted for meals. this amount is based on the daily meal allowance and the total travel days (# of nights+1).
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
What key should you press and hold to select and open multiple files at one time? enter alt control esc
Answers: 1
You know the right answer?
Write a program to store water usage data of 4 customers in a text file. the program asks the user t...
Questions
question
Mathematics, 07.02.2021 16:10
question
Social Studies, 07.02.2021 16:20
question
History, 07.02.2021 16:20