Menu

[Solved]-Python 3 Lab Need Create Program Writes Sales Data File Need Prompt Filename Make Sure Che Q37258256

IN PYTHON 3!

For this lab, you will need to create a program the writes salesdata to a file.

You will need to prompt for a filename and make sure to checkand handle the case if you cannot open the file by printing themessage:

The file #### cannot be written to!

Please try again…

(where #### is the input from the user)

You will then collect information for a line in the sales datafile. The information is:

Client name

Service name

Amount

Date

If the amount is not a valid floating point number, you mustoutput the error message:

The amount, ####, cannot be converted to a float!

Please try again…

(where #### represents the user input)

The user will enter a -1 for the client name when they arefinished entering data.

A successful session would look like:

Please enter a filename: salesdata.txt

Please enter sales data.

Use a value of -1 for client name to exit.

Client name: Fred Rogers

Service: TV Host

Amount: 32.56

Date: 10/20/1970

Client name: Rick Sanchez

Service: Cloning

Amount: 1200.56

Date: 1/13/2050

Client name: Morty Smith

Service: Alien Cleaning

Amount: 534.78

Date: 4/2/2019

Client name: -1

OUTPUT MUST MATCH THE EXAMPLE GIVEN!

Expert Answer


Answer to IN PYTHON 3! For this lab, you will need to create a program the writes sales data to a file. You will need to prompt fo… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *