Question: Open the output file using a with statement. Start a while loop that continues until the user presses Enter ( or Return on a Mac

Open the output file using a with statement.
Start a while loop that continues until the user presses Enter (or Return on a Mac) for the LP title.
Prompt the user for the following information about each LP:
LP Title: The title of the LP.Artist(s) Name(s): The name(s) of the artist(s).Regular Price: The regular price of the LP (float).Discount (%): The discount on the LP during the sale (integer).
After capturing the details for each LP, append the data to a file named lpsale.txt, with each piece of data on its own line.
Once the user presses Enter (or Return on a Mac) for the LP tit
example input/Output
Enter the album's title: Dionne Warwick's Golden Hits
Enter the artist(s) name(s): Dionne Warwick
Enter the regular price: 22.75
Enter the discount in percent: 12
Enter the album's title: 1989
Enter the artist(s) name(s): Taylor Swift
Enter the regular price: 23.10
Enter the discount in percent: 14
Enter the album's title: Meet the Beatles!
Enter the artist(s) name(s): The Beatles
Enter the regular price: 23.05
Enter the discount in percent: 13
Enter the album's title:
The LP sale data has been successfully stored in lpsale.txt.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!