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, 22.06.2019 09:40
Sarah is having a hard time finding a template for her advertising business that she may be able to use at a later date and also make it available to her colleagues
Answers: 1
question
Computers and Technology, 23.06.2019 12:20
When guido van rossum created python, he wanted to make a language that was more than other programming languages. a. code-based b. human-readable c. complex d. functional
Answers: 1
question
Computers and Technology, 23.06.2019 22:30
Apart from confidential information, what other information does nda to outline? ndas not only outline confidential information, but they also enable you to outline .
Answers: 1
question
Computers and Technology, 23.06.2019 23:30
A. in packet tracer, only the server-pt device can act as a server. desktop or laptop pcs cannot act as a server. based on your studies so far, explain the client-server model.
Answers: 2
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, 22.06.2019 14:30
question
Mathematics, 22.06.2019 14:30
Questions on the website: 13722363