Anyone Airlines is having a sale on flights leaving from Tampa. Write a program that uses...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Anyone Airlines is having a sale on flights leaving from Tampa. Write a program that uses a while loop to store to a file the names of destinations, regular prices, and price reductions (as percents) for selected flights in the promotion. The program should enable the user to enter this data from the keyboard as shown below. Integers should be used for all numerical input. Each datum should be stored on its own line in the file. The while loop should repeat until the user presses Enter (Return on a Mac) for the name. Then, the file should be closed and a message should be displayed. See Example Output. Example Output Enter destination name or Enter to quit San Francisco Enter flight's regular price 550 Enter reduction percent for sale 10 Enter destination name or Enter to quit New Orleans Enter flight's regular price 330 Enter reduction percent for sale 10 Enter destination name or Enter to quit Atlanta Enter flight's regular price 295 Enter reduction percent for sale 20 Enter destination name or Enter to quit File was created program6_2.py This program reads the text file created in the program above. Use f-strings along with any necessary calculations to create a table with a row with the indicated columns for each destination as shown below. $ signs are not required but use float with 2 decimal positions for numerical output. Choose your own column widths but include column headings as shown. Example Output DESTINATION San Francisco New Orleans Atlanta REG.PRICE REDUCED SALE PRICE 550.00 55.00 495.00 330.00 33.00 297.00 295.00 59.00 236.00 Anyone Airlines is having a sale on flights leaving from Tampa. Write a program that uses a while loop to store to a file the names of destinations, regular prices, and price reductions (as percents) for selected flights in the promotion. The program should enable the user to enter this data from the keyboard as shown below. Integers should be used for all numerical input. Each datum should be stored on its own line in the file. The while loop should repeat until the user presses Enter (Return on a Mac) for the name. Then, the file should be closed and a message should be displayed. See Example Output. Example Output Enter destination name or Enter to quit San Francisco Enter flight's regular price 550 Enter reduction percent for sale 10 Enter destination name or Enter to quit New Orleans Enter flight's regular price 330 Enter reduction percent for sale 10 Enter destination name or Enter to quit Atlanta Enter flight's regular price 295 Enter reduction percent for sale 20 Enter destination name or Enter to quit File was created program6_2.py This program reads the text file created in the program above. Use f-strings along with any necessary calculations to create a table with a row with the indicated columns for each destination as shown below. $ signs are not required but use float with 2 decimal positions for numerical output. Choose your own column widths but include column headings as shown. Example Output DESTINATION San Francisco New Orleans Atlanta REG.PRICE REDUCED SALE PRICE 550.00 55.00 495.00 330.00 33.00 297.00 295.00 59.00 236.00
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
Read the case study "Southwest Airlines," found in Part 2 of your textbook. Review the "Guide to Case Analysis" found on pp. CA1 - CA11 of your textbook. (This guide follows the last case in the...
-
Determine how current values might be determined for investments, land, buildings, equipment, patents, copyrights, trademarks, and franchises. How might the use of current values in the accounting...
-
When a beet armyworm caterpillar eats corn seedlings, it secretes volicitin onto the injured leaves. The leaves respond by releasing a volatile cocktail of terpenes and indoles that attract parasitic...
-
Linda and Don are married and file a joint return. In 2022, they received $12,000 in Social Security benefits and $35,000 in taxable pension benefits and interest. a. Compute the couples adjusted...
-
As a battery is used to charge a capacitor, does the overall charge inside the battery get smaller, get greater, or stay the same?
-
Tried and True Clothing has opened four new stores in college towns across the state. Data on monthly sales volume and labor hours are given below. Which store location has the highest...
-
16. A signal containing multiple frequencies is shown in figure A. It is passed through 2 different filters and then outputs are shown in figure B & C. M (A) S (B) sha (C) (a) B corresponds to low...
-
Be aware that some of the problems are dependent on each other; therefore, completing the requirements out of order can create errors. Use comments to appropriately number your answers. In...
-
Summarize The Tax Cuts and Jobs Act (TCJA) significantly increased the standard deduction for all taxpayers. Single filers increased from $6,350 to $12,000, heads of households filed from $9,350 to...
-
What is a way that compensation professionals can help leverage the value of human capital?
-
An employee who oversees the counting and depositing cash holdings at end of the day urgently needs some extra cash to purchase new tires for her car. What is the part of fraud triangle does this...
-
What does Hofstede's Uncertainty Avoidance Dimension refer?
-
You, CPA, are the auditor of Sticks and Stones Ltd. (SSL), whose year end is December 31, Year 1. At year end SSL has accrued a provision of $100,000 related to an ongoing lawsuit and has included a...
-
Read the case study HOW TO GET AWAY WITH MURDER and write a paper about it: Jay and Sam, two university students are best friends and live in Utah. Their history teacher, Professor Ben Howard plans a...
-
Make an argument that Williams had a right to delay the closing until after August 1.
-
Reconsider the data from Problem 57 (Orpheum Productions lighting enhancement). Assume that any money not invested in the lighting enhancements will be placed in an interest-bearing account earning...
-
An investor has \($100,000\) to invest in a business venture, or she can earn 10 percent/year with a \($100,000\) certificate of deposit for 4 years. Three possible business ventures have been...
-
This problem is related to Problem 8. Jeff has $10,000 to invest for a period of 5 years. The following three alternatives are available at his bank: Data from problem 8 Jeff has $10,000 to invest...
Study smarter with the SolutionInn App